/*!
 * Name: Tiny.js
 * Description: The Tiny engine is an HTML5 game engine designed to be lightweight and concise JavaScript-friendly syntax, it will friendly for mobile.
 * Author: yiqi
 * Version: v1.3.1
	教程网站：http://tinyjs.net/guide/basics.html
 */
!function (t, e) {
    "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e(t.Tiny = {})
}
(this, function (t) {
    "use strict";
    var e = Object.freeze({
        get MoveBy() {
            return yr
        },
        get MoveTo() {
            return _r
        },
        get ScaleBy() {
            return mr
        },
        get ScaleTo() {
            return xr
        },
        get RotateBy() {
            return Tr
        },
        get RotateTo() {
            return wr
        },
        get JumpTo() {
            return br
        },
        get Blink() {
            return Er
        },
        get FadeTo() {
            return kr
        },
        get FadeIn() {
            return Sr
        },
        get FadeOut() {
            return Cr
        },
        get TintBy() {
            return Or
        },
        get TintTo() {
            return Pr
        },
        get RepeatForever() {
            return Mr
        },
        get Repeat() {
            return Ar
        },
        get Back() {
            return Ir
        }
    }),
    i = Object.getOwnPropertySymbols,
    n = Object.prototype.hasOwnProperty,
    r = Object.prototype.propertyIsEnumerable;
    var s = function () {
        try {
            if (!Object.assign)
                return !1;
            var t = new String("abc");
            if (t[5] = "de", "5" === Object.getOwnPropertyNames(t)[0])
                return !1;
            for (var e = {}, i = 0; i < 10; i++)
                e["_" + String.fromCharCode(i)] = i;
            if ("0123456789" !== Object.getOwnPropertyNames(e).map(function (t) {
                    return e[t]
                }).join(""))
                return !1;
            var n = {};
            return "abcdefghijklmnopqrst".split("").forEach(function (t) {
                n[t] = t
            }),
            "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, n)).join("")
        } catch (t) {
            return !1
        }
    }
    () ? Object.assign : function (t, e) {
        for (var s, a, o = function (t) {
            if (null === t || void 0 === t)
                throw new TypeError("Object.assign cannot be called with null or undefined");
                return Object(t)
            }
                (t), h = 1; h < arguments.length; h++) {
                for (var u in s = Object(arguments[h]))
                    n.call(s, u) && (o[u] = s[u]);
                if (i) {
                    a = i(s);
                    for (var l = 0; l < a.length; l++)
                        r.call(s, a[l]) && (o[a[l]] = s[a[l]])
                }
            }
        return o
    };
    Object.assign || (Object.assign = s);
    if (Date.now && Date.prototype.getTime || (Date.now = function () {
            return (new Date).getTime()
        }), !(window.performance && window.performance.now && window.performance.timing)) {
        var a = null;
        window.performance || (window.performance = {}),
        window.performance.timing && window.performance.timing.navigationStart ? a = window.performance.timing.navigationStart : (a = Date.now(), window.performance.timing = {
                    navigationStart: a
                }),
        window.performance.now = function () {
            return Date.now() - a
        }
    }
    for (var o = Date.now(), h = ["ms", "moz", "webkit", "o"], u = 0; u < h.length && !window.requestAnimationFrame; ++u) {
        var l = h[u];
        window.requestAnimationFrame = window[l + "RequestAnimationFrame"],
        window.cancelAnimationFrame = window[l + "CancelAnimationFrame"] || window[l + "CancelRequestAnimationFrame"]
    }
    function c(t, e) {
        return t(e = {
                exports: {}
            }, e.exports),
        e.exports
    }
    window.requestAnimationFrame || (window.requestAnimationFrame = function (t) {
        if ("function" != typeof t)
            throw new TypeError(t + "is not a function");
        var e = Date.now(),
        i = 16 + o - e;
        return i < 0 && (i = 0),
        o = e,
        setTimeout(function () {
            o = Date.now(),
            t(window.performance.now())
        }, i)
    }),
    window.cancelAnimationFrame || (window.cancelAnimationFrame = function (t) {
        return clearTimeout(t)
    }),
    Math.sign || (Math.sign = function (t) {
        return 0 === (t = Number(t)) || isNaN(t) ? t : t > 0 ? 1 : -1
    }),
    Number.isInteger || (Number.isInteger = function (t) {
        return "number" == typeof t && isFinite(t) && Math.floor(t) === t
    }),
    window.ArrayBuffer || (window.ArrayBuffer = Array),
    window.Float32Array || (window.Float32Array = Array),
    window.Uint32Array || (window.Uint32Array = Array),
    window.Uint16Array || (window.Uint16Array = Array);
    var d,
    f = c(function (t) {
        var e = Object.prototype.hasOwnProperty,
        i = "~";
        function n() {}
        function r(t, e, n, r, s) {
            if ("function" != typeof n)
                throw new TypeError("The listener must be a function");
            var a = new function (t, e, i) {
                this.fn = t,
                this.context = e,
                this.once = i || !1
            }
            (n, r || t, s),
            o = i ? i + e : e;
            return t._events[o] ? t._events[o].fn ? t._events[o] = [t._events[o], a] : t._events[o].push(a) : (t._events[o] = a, t._eventsCount++),
            t
        }
        function s(t, e) {
            0 == --t._eventsCount ? t._events = new n : delete t._events[e]
        }
        function a() {
            this._events = new n,
            this._eventsCount = 0
        }
        Object.create && (n.prototype = Object.create(null), (new n).__proto__ || (i = !1)),
        a.prototype.eventNames = function () {
            var t,
            n,
            r = [];
            if (0 === this._eventsCount)
                return r;
            for (n in t = this._events)
                e.call(t, n) && r.push(i ? n.slice(1) : n);
            return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(t)) : r
        },
        a.prototype.listeners = function (t) {
            var e = i ? i + t : t,
            n = this._events[e];
            if (!n)
                return [];
            if (n.fn)
                return [n.fn];
            for (var r = 0, s = n.length, a = new Array(s); r < s; r++)
                a[r] = n[r].fn;
            return a
        },
        a.prototype.listenerCount = function (t) {
            var e = i ? i + t : t,
            n = this._events[e];
            return n ? n.fn ? 1 : n.length : 0
        },
        a.prototype.emit = function (t, e, n, r, s, a) {
            var o = i ? i + t : t;
            if (!this._events[o])
                return !1;
            var h,
            u,
            l = this._events[o],
            c = arguments.length;
            if (l.fn) {
                switch (l.once && this.removeListener(t, l.fn, void 0, !0), c) {
                case 1:
                    return l.fn.call(l.context),
                    !0;
                case 2:
                    return l.fn.call(l.context, e),
                    !0;
                case 3:
                    return l.fn.call(l.context, e, n),
                    !0;
                case 4:
                    return l.fn.call(l.context, e, n, r),
                    !0;
                case 5:
                    return l.fn.call(l.context, e, n, r, s),
                    !0;
                case 6:
                    return l.fn.call(l.context, e, n, r, s, a),
                    !0
                }
                for (u = 1, h = new Array(c - 1); u < c; u++)
                    h[u - 1] = arguments[u];
                l.fn.apply(l.context, h)
            } else {
                var d,
                f = l.length;
                for (u = 0; u < f; u++)
                    switch (l[u].once && this.removeListener(t, l[u].fn, void 0, !0), c) {
                    case 1:
                        l[u].fn.call(l[u].context);
                        break;
                    case 2:
                        l[u].fn.call(l[u].context, e);
                        break;
                    case 3:
                        l[u].fn.call(l[u].context, e, n);
                        break;
                    case 4:
                        l[u].fn.call(l[u].context, e, n, r);
                        break;
                    default:
                        if (!h)
                            for (d = 1, h = new Array(c - 1); d < c; d++)
                                h[d - 1] = arguments[d];
                        l[u].fn.apply(l[u].context, h)
                    }
            }
            return !0
        },
        a.prototype.on = function (t, e, i) {
            return r(this, t, e, i, !1)
        },
        a.prototype.once = function (t, e, i) {
            return r(this, t, e, i, !0)
        },
        a.prototype.removeListener = function (t, e, n, r) {
            var a = i ? i + t : t;
            if (!this._events[a])
                return this;
            if (!e)
                return s(this, a), this;
            var o = this._events[a];
            if (o.fn)
                o.fn !== e || r && !o.once || n && o.context !== n || s(this, a);
            else {
                for (var h = 0, u = [], l = o.length; h < l; h++)
                    (o[h].fn !== e || r && !o[h].once || n && o[h].context !== n) && u.push(o[h]);
                u.length ? this._events[a] = 1 === u.length ? u[0] : u : s(this, a)
            }
            return this
        },
        a.prototype.removeAllListeners = function (t) {
            var e;
            return t ? (e = i ? i + t : t, this._events[e] && s(this, e)) : (this._events = new n, this._eventsCount = 0),
            this
        },
        a.prototype.off = a.prototype.removeListener,
        a.prototype.addListener = a.prototype.on,
        a.prefixed = i,
        a.EventEmitter = a,
        t.exports = a
    }),
    v = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
        return typeof t
    }
     : function (t) {
        return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
    },
    p = function (t, e) {
        if (!(t instanceof e))
            throw new TypeError("Cannot call a class as a function")
    },
    g = function () {
        function t(t, e) {
            for (var i = 0; i < e.length; i++) {
                var n = e[i];
                n.enumerable = n.enumerable || !1,
                n.configurable = !0,
                "value" in n && (n.writable = !0),
                Object.defineProperty(t, n.key, n)
            }
        }
        return function (e, i, n) {
            return i && t(e.prototype, i),
            n && t(e, n),
            e
        }
    }
    (),
    y = Object.assign || function (t) {
        for (var e = 1; e < arguments.length; e++) {
            var i = arguments[e];
            for (var n in i)
                Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n])
        }
        return t
    },
    _ = function t(e, i, n) {
        null === e && (e = Function.prototype);
        var r = Object.getOwnPropertyDescriptor(e, i);
        if (void 0 === r) {
            var s = Object.getPrototypeOf(e);
            return null === s ? void 0 : t(s, i, n)
        }
        if ("value" in r)
            return r.value;
        var a = r.get;
        return void 0 !== a ? a.call(n) : void 0
    },
    m = function (t, e) {
        if ("function" != typeof e && null !== e)
            throw new TypeError("Super expression must either be null or a function, not " + typeof e);
        t.prototype = Object.create(e && e.prototype, {
            constructor: {
                value: t,
                enumerable: !1,
                writable: !0,
                configurable: !0
            }
        }),
        e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e)
    },
    x = function (t, e) {
        if (!t)
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return !e || "object" != typeof e && "function" != typeof e ? t : e
    },
    T = function () {
        function t() {
            p(this, t),
            this._tweens = {},
            this._tweensAddedDuringUpdate = {}
        }
        return g(t, [{
                    key: "getAll",
                    value: function () {
                        return Object.keys(this._tweens).map(function (t) {
                            return this._tweens[t]
                        }
                            .bind(this))
                    }
                }, {
                    key: "removeAll",
                    value: function () {
                        this._tweens = {}
                    }
                }, {
                    key: "add",
                    value: function (t) {
                        this._tweens[t.getId()] = t,
                        this._tweensAddedDuringUpdate[t.getId()] = t
                    }
                }, {
                    key: "remove",
                    value: function (t) {
                        delete this._tweens[t.getId()],
                        delete this._tweensAddedDuringUpdate[t.getId()]
                    }
                }, {
                    key: "update",
                    value: function (t, e) {
                        var i = Object.keys(this._tweens);
                        if (0 === i.length)
                            return !1;
                        for (t = void 0 !== t ? t : w.now(); i.length > 0; ) {
                            this._tweensAddedDuringUpdate = {};
                            for (var n = 0; n < i.length; n++)
                                if (this._tweens[i[n]] && this._tweens[i[n]]._isPlaying) {
                                    var r = this._tweens[i[n]]._passedTime;
                                    !1 === this._tweens[i[n]].update(r ? t - r : t) && (this._tweens[i[n]] && (this._tweens[i[n]]._isPlaying = !1), e || delete this._tweens[i[n]])
                                }
                            i = Object.keys(this._tweensAddedDuringUpdate)
                        }
                        return !0
                    }
                }, {
                    key: "pause",
                    value: function () {
                        var t = Object.keys(this._tweens);
                        if (0 === t.length)
                            return !1;
                        for (var e = 0; e < t.length; e++)
                            this._tweens[t[e]].pause()
                    }
                }, {
                    key: "resume",
                    value: function () {
                        var t = Object.keys(this._tweens);
                        if (0 === t.length)
                            return !1;
                        for (var e = 0; e < t.length; e++)
                            this._tweens[t[e]].resume()
                    }
                }
            ]),
        t
    }
    (),
    w = new T;
    w.Group = T,
    w._nextId = 0,
    w.nextId = function () {
        return w._nextId++
    },
    "undefined" == typeof window && "undefined" != typeof process ? w.now = function () {
        var t = process.hrtime();
        return 1e3 * t[0] + t[1] / 1e6
    }
     : "undefined" != typeof window && void 0 !== window.performance && void 0 !== window.performance.now ? w.now = window.performance.now.bind(window.performance) : void 0 !== Date.now ? w.now = Date.now : w.now = function () {
        return (new Date).getTime()
    },
    w.Tween = function (t, e) {
        this._object = t,
        this._valuesStart = {},
        this._valuesEnd = {},
        this._valuesStartRepeat = {},
        this._duration = 1e3,
        this._repeat = 0,
        this._repeatDelayTime = void 0,
        this._yoyo = !1,
        this._isPlaying = !1,
        this._reversed = !1,
        this._pauseTime = 0,
        this._passedTime = 0,
        this._delayTime = 0,
        this._startTime = null,
        this._easingFunction = w.Easing.Linear.None,
        this._interpolationFunction = w.Interpolation.Linear,
        this._chainedTweens = [],
        this._onStartCallback = null,
        this._onStartCallbackFired = !1,
        this._onUpdateCallback = null,
        this._onCompleteCallback = null,
        this._onStopCallback = null,
        this._group = e || w,
        this._id = w.nextId()
    },
    w.Tween.prototype = {
        getId: function () {
            return this._id
        },
        isPlaying: function () {
            return this._isPlaying
        },
        to: function (t, e) {
            return this._valuesEnd = t,
            void 0 !== e && (this._duration = e),
            this
        },
        start: function (t) {
            for (var e in this._group.add(this), this._isPlaying = !0, this._onStartCallbackFired = !1, this._startTime = void 0 !== t ? t : w.now(), this._startTime += this._delayTime, this._valuesEnd) {
                if (this._valuesEnd[e]instanceof Array) {
                    if (0 === this._valuesEnd[e].length)
                        continue;
                    this._valuesEnd[e] = [this._object[e]].concat(this._valuesEnd[e])
                }
                void 0 !== this._object[e] && (this._valuesStart[e] = this._object[e], this._valuesStart[e]instanceof Array == !1 && (this._valuesStart[e] *= 1), this._valuesStartRepeat[e] = this._valuesStart[e] || 0)
            }
            return this
        },
        stop: function () {
            return this._isPlaying ? (this._group.remove(this), this._isPlaying = !1, null !== this._onStopCallback && this._onStopCallback.call(this._object, this._object), this.stopChainedTweens(), this) : this
        },
        pause: function () {
            if (!this._isPlaying)
                return this;
            this._isPlaying = !1,
            this._pauseTime = w.now() - this._passedTime
        },
        resume: function () {
            if (this._isPlaying)
                return this;
            this._isPlaying = !0,
            this._passedTime = w.now() - this._pauseTime
        },
        end: function () {
            return this.update(this._startTime + this._duration),
            this
        },
        stopChainedTweens: function () {
            for (var t = 0, e = this._chainedTweens.length; t < e; t++)
                this._chainedTweens[t].stop()
        },
        delay: function (t) {
            return this._delayTime = t,
            this
        },
        repeat: function (t) {
            return this._repeat = t,
            this
        },
        repeatDelay: function (t) {
            return this._repeatDelayTime = t,
            this
        },
        yoyo: function (t) {
            return this._yoyo = t,
            this
        },
        easing: function (t) {
            return this._easingFunction = t,
            this
        },
        interpolation: function (t) {
            return this._interpolationFunction = t,
            this
        },
        chain: function () {
            return this._chainedTweens = arguments,
            this
        },
        onStart: function (t) {
            return this._onStartCallback = t,
            this
        },
        onUpdate: function (t) {
            return this._onUpdateCallback = t,
            this
        },
        onComplete: function (t) {
            return this._passedTime = 0,
            this._onCompleteCallback = t,
            this
        },
        onStop: function (t) {
            return this._onStopCallback = t,
            this
        },
        update: function (t) {
            var e = void 0,
            i = void 0;
            if (t < this._startTime)
                return !0;
            !1 === this._onStartCallbackFired && (null !== this._onStartCallback && this._onStartCallback.call(this._object, this._object), this._onStartCallbackFired = !0),
            i = (i = (t - this._startTime) / this._duration) > 1 ? 1 : i;
            var n = this._easingFunction(i);
            for (e in this._valuesEnd)
                if (void 0 !== this._valuesStart[e]) {
                    var r = this._valuesStart[e] || 0,
                    s = this._valuesEnd[e];
                    s instanceof Array ? this._object[e] = this._interpolationFunction(s, n) : ("string" == typeof s && (s = "+" === s.charAt(0) || "-" === s.charAt(0) ? r + parseFloat(s) : parseFloat(s)), "number" == typeof s && (this._object[e] = r + (s - r) * n))
                }
            if (null !== this._onUpdateCallback && this._onUpdateCallback.call(this._object, n), 1 === i) {
                if (this._repeat > 0) {
                    for (e in isFinite(this._repeat) && this._repeat--, this._valuesStartRepeat) {
                        if ("string" == typeof this._valuesEnd[e] && (this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(this._valuesEnd[e])), this._yoyo) {
                            var a = this._valuesStartRepeat[e];
                            this._valuesStartRepeat[e] = this._valuesEnd[e],
                            this._valuesEnd[e] = a
                        }
                        this._valuesStart[e] = this._valuesStartRepeat[e]
                    }
                    return this._yoyo && (this._reversed = !this._reversed),
                    void 0 !== this._repeatDelayTime ? this._startTime = t + this._repeatDelayTime : this._startTime = t + this._delayTime,
                    !0
                }
                null !== this._onCompleteCallback && this._onCompleteCallback.call(this._object, this._object);
                for (var o = 0, h = this._chainedTweens.length; o < h; o++)
                    this._chainedTweens[o].start(this._startTime + this._duration);
                return !1
            }
            return !0
        }
    },
    w.Easing = {
        Linear: {
            None: function (t) {
                return t
            }
        },
        Quadratic: {
            In: function (t) {
                return t * t
            },
            Out: function (t) {
                return t * (2 - t)
            },
            InOut: function (t) {
                return (t *= 2) < 1 ? .5 * t * t :  - .5 * (--t * (t - 2) - 1)
            }
        },
        Cubic: {
            In: function (t) {
                return t * t * t
            },
            Out: function (t) {
                return --t * t * t + 1
            },
            InOut: function (t) {
                return (t *= 2) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2)
            }
        },
        Quartic: {
            In: function (t) {
                return t * t * t * t
            },
            Out: function (t) {
                return 1 - --t * t * t * t
            },
            InOut: function (t) {
                return (t *= 2) < 1 ? .5 * t * t * t * t :  - .5 * ((t -= 2) * t * t * t - 2)
            }
        },
        Quintic: {
            In: function (t) {
                return t * t * t * t * t
            },
            Out: function (t) {
                return --t * t * t * t * t + 1
            },
            InOut: function (t) {
                return (t *= 2) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2)
            }
        },
        Sinusoidal: {
            In: function (t) {
                return 1 - Math.cos(t * Math.PI / 2)
            },
            Out: function (t) {
                return Math.sin(t * Math.PI / 2)
            },
            InOut: function (t) {
                return .5 * (1 - Math.cos(Math.PI * t))
            }
        },
        Exponential: {
            In: function (t) {
                return 0 === t ? 0 : Math.pow(1024, t - 1)
            },
            Out: function (t) {
                return 1 === t ? 1 : 1 - Math.pow(2, -10 * t)
            },
            InOut: function (t) {
                return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ? .5 * Math.pow(1024, t - 1) : .5 * (2 - Math.pow(2, -10 * (t - 1)))
            }
        },
        Circular: {
            In: function (t) {
                return 1 - Math.sqrt(1 - t * t)
            },
            Out: function (t) {
                return Math.sqrt(1 - --t * t)
            },
            InOut: function (t) {
                return (t *= 2) < 1 ?  - .5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1)
            }
        },
        Elastic: {
            In: function (t) {
                return 0 === t ? 0 : 1 === t ? 1 : -Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI)
            },
            Out: function (t) {
                return 0 === t ? 0 : 1 === t ? 1 : Math.pow(2, -10 * t) * Math.sin(5 * (t - .1) * Math.PI) + 1
            },
            InOut: function (t) {
                return 0 === t ? 0 : 1 === t ? 1 : (t *= 2) < 1 ?  - .5 * Math.pow(2, 10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) : .5 * Math.pow(2, -10 * (t - 1)) * Math.sin(5 * (t - 1.1) * Math.PI) + 1
            }
        },
        Back: {
            In: function (t) {
                var e = 1.70158;
                return t * t * ((e + 1) * t - e)
            },
            Out: function (t) {
                var e = 1.70158;
                return --t * t * ((e + 1) * t + e) + 1
            },
            InOut: function (t) {
                var e = 2.5949095;
                return (t *= 2) < 1 ? t * t * ((e + 1) * t - e) * .5 : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2)
            }
        },
        Bounce: {
            In: function (t) {
                return 1 - w.Easing.Bounce.Out(1 - t)
            },
            Out: function (t) {
                return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375
            },
            InOut: function (t) {
                return t < .5 ? .5 * w.Easing.Bounce.In(2 * t) : .5 * w.Easing.Bounce.Out(2 * t - 1) + .5
            }
        }
    },
    w.Interpolation = {
        Linear: function (t, e) {
            var i = t.length - 1,
            n = i * e,
            r = Math.floor(n),
            s = w.Interpolation.Utils.Linear;
            return e < 0 ? s(t[0], t[1], n) : e > 1 ? s(t[i], t[i - 1], i - n) : s(t[r], t[r + 1 > i ? i : r + 1], n - r)
        },
        Bezier: function (t, e) {
            for (var i = 0, n = t.length - 1, r = Math.pow, s = w.Interpolation.Utils.Bernstein, a = 0; a <= n; a++)
                i += r(1 - e, n - a) * r(e, a) * t[a] * s(n, a);
            return i
        },
        CatmullRom: function (t, e) {
            var i = t.length - 1,
            n = i * e,
            r = Math.floor(n),
            s = w.Interpolation.Utils.CatmullRom;
            return t[0] === t[i] ? (e < 0 && (r = Math.floor(n = i * (1 + e))), s(t[(r - 1 + i) % i], t[r], t[(r + 1) % i], t[(r + 2) % i], n - r)) : e < 0 ? t[0] - (s(t[0], t[0], t[1], t[1], -n) - t[0]) : e > 1 ? t[i] - (s(t[i], t[i], t[i - 1], t[i - 1], n - i) - t[i]) : s(t[r ? r - 1 : 0], t[r], t[i < r + 1 ? i : r + 1], t[i < r + 2 ? i : r + 2], n - r)
        },
        Utils: {
            Linear: function (t, e, i) {
                return (e - t) * i + t
            },
            Bernstein: function (t, e) {
                var i = w.Interpolation.Utils.Factorial;
                return i(t) / i(e) / i(t - e)
            },
            Factorial: (d = [1], function (t) {
                var e = 1;
                if (d[t])
                    return d[t];
                for (var i = t; i > 1; i--)
                    e *= i;
                return d[t] = e,
                e
            }),
            CatmullRom: function (t, e, i, n, r) {
                var s = .5 * (i - t),
                a = .5 * (n - e),
                o = r * r;
                return (2 * e - 2 * i + s + a) * (r * o) + (-3 * e + 3 * i - 2 * s - a) * o + s * r + e
            }
        }
    };
    var b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    var E = Object.freeze({
        encodeBinary: function (t) {
            for (var e = "", i = 0; i < t.length; ) {
                for (var n = [0, 0, 0], r = [0, 0, 0, 0], s = 0; s < n.length; ++s)
                    i < t.length ? n[s] = 255 & t.charCodeAt(i++) : n[s] = 0;
                switch (r[0] = n[0] >> 2, r[1] = (3 & n[0]) << 4 | n[1] >> 4, r[2] = (15 & n[1]) << 2 | n[2] >> 6, r[3] = 63 & n[2], i - (t.length - 1)) {
                case 2:
                    r[3] = 64,
                    r[2] = 64;
                    break;
                case 1:
                    r[3] = 64
                }
                for (var a = 0; a < r.length; ++a)
                    e += b.charAt(r[a])
            }
            return e
        }
    });
    function k(t, e) {
        if (t && e)
            for (var i = Object.keys(e), n = 0; n < i.length; ++n) {
                var r = i[n];
                Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r))
            }
    }
    var S = [];
    function C(t, e) {
        S.push(t, e)
    }
    function O() {
        for (var t = 0; t < S.length; t += 2)
            k(S[t], S[t + 1]);
        S.length = 0
    }
    var P = Object.freeze({
        mixin: k,
        delayMixin: C,
        performMixins: O
    }),
    M = function (t, e) {
        e = e || {};
        for (var i = {
                key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"],
                q: {
                    name: "queryKey",
                    parser: /(?:^|&)([^&=]*)=?([^&]*)/g
                },
                parser: {
                    strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
                    loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
                }
            }, n = i.parser[e.strictMode ? "strict" : "loose"].exec(t), r = {}, s = 14; s--; )
            r[i.key[s]] = n[s] || "";
        return r[i.q.name] = {},
        r[i.key[12]].replace(i.q.parser, function (t, e, n) {
            e && (r[i.q.name][e] = n)
        }),
        r
    };
    function A(t, e) {
        var i = M(t, {
            strictMode: !0
        });
        return M(e, {
            strictMode: !0
        }).protocol ? e : (e = e.replace(/^(\.)\//, ""), /^\.{2}\//.test(e) && (e = e.replace(/^(\.){2}\//, ""), t = t.replace(/[^\/]*\/[^\/]*$/, "")), /^\/[^\/]*/.test(e) ? t.replace(new RegExp(i.path + "$"), e) : t.replace(i.file, "") + e)
    }
    var I = Object.freeze({
        resolve: A,
        parse: M
    }),
    R = void 0;
    function D(t) {
        var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : window.location;
        if (0 === t.indexOf("data:"))
            return "";
        R || (R = document.createElement("a")),
        R.href = t;
        var i = !(t = M(R.href, {
                strictMode: !0
            })).port && "" === e.port || t.port === e.port,
        n = t.protocol ? t.protocol + ":" : "";
        return t.host === e.hostname && i && n === e.protocol ? "" : "anonymous"
    }
    var L,
    F = /iPhone/i,
    N = /iPod/i,
    U = /iPad/i,
    B = /(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,
    X = /Android/i,
    j = /(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,
    G = /(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,
    W = /Windows Phone/i,
    Y = /(?=.*\bWindows\b)(?=.*\bARM\b)/i,
    H = /BlackBerry/i,
    V = /BB10/i,
    z = /Opera Mini/i,
    q = /(CriOS|Chrome)(?=.*\bMobile\b)/i,
    K = /(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,
    Z = new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)", "i"),
    J = function (t, e) {
        return t.test(e)
    },
    Q = function (t) {
        var e = t || navigator.userAgent,
        i = e.split("[FBAN");
        if (void 0 !== i[1] && (e = i[0]), void 0 !== (i = e.split("Twitter"))[1] && (e = i[0]), this.apple = {
                phone: J(F, e),
                ipod: J(N, e),
                tablet: !J(F, e) && J(U, e),
                device: J(F, e) || J(N, e) || J(U, e)
            }, this.amazon = {
                phone: J(j, e),
                tablet: !J(j, e) && J(G, e),
                device: J(j, e) || J(G, e)
            }, this.android = {
                phone: J(j, e) || J(B, e),
                tablet: !J(j, e) && !J(B, e) && (J(G, e) || J(X, e)),
                device: J(j, e) || J(G, e) || J(B, e) || J(X, e)
            }, this.windows = {
                phone: J(W, e),
                tablet: J(Y, e),
                device: J(W, e) || J(Y, e)
            }, this.other = {
                blackberry: J(H, e),
                blackberry10: J(V, e),
                opera: J(z, e),
                firefox: J(K, e),
                chrome: J(q, e),
                device: J(H, e) || J(V, e) || J(z, e) || J(K, e) || J(q, e)
            }, this.seven_inch = J(Z, e), this.any = this.apple.device || this.android.device || this.windows.device || this.other.device || this.seven_inch, this.phone = this.apple.phone || this.android.phone || this.windows.phone, this.tablet = this.apple.tablet || this.android.tablet || this.windows.tablet, "undefined" == typeof window)
            return this
    },
    $ = ((L = new Q).Class = Q, L),
    tt = 2 * Math.PI,
    et = 180 / Math.PI,
    it = Math.PI / 180,
    nt = /\.(\w{3,4})(?:$|\?|#)/i,
    rt = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,
    st = /<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,
    at = /@([0-9\.]+)x/,
    ot = Array.isArray || function (t) {
        return "[object Array]" === Object.prototype.toString.call(t)
    };
    function ht(t) {
        return "[object Function]" === Object.prototype.toString.call(t)
    }
    function ut(t) {
        return "[object Number]" === Object.prototype.toString.call(t)
    }
    function lt(t) {
        return "string" == typeof t
    }
    function ct(t) {
        return void 0 === t
    }
    function dt(t) {
        return "[object Object]" === Object.prototype.toString.call(t)
    }
    function ft() {
        return window.performance.timing.navigationStart + window.performance.now()
    }
    function vt(t, e) {
        return ot(t) && (e = t[1], t = t[0]),
        Math.floor(Math.random() * (e - t + 1)) + t
    }
    function pt(t, e) {
        return (e = e || [])[0] = (t >> 16 & 255) / 255,
        e[1] = (t >> 8 & 255) / 255,
        e[2] = (255 & t) / 255,
        e
    }
    function gt(t) {
        return t = t.toString(16),
        "#" + (t = "000000".substr(0, 6 - t.length) + t)
    }
    function yt(t) {
        return (255 * t[0] << 16) + (255 * t[1] << 8) + (255 * t[2] | 0)
    }
    function _t(t) {
        var e = pt(t);
        return It(255 * e[0], 255 * e[1], 255 * e[2])
    }
    function mt(t) {
        return t * it
    }
    function xt(t) {
        return t * et
    }
    function Tt() {
        for (var t = "0x", e = 0; e < 6; e++)
            t += "0123456789ABCDEF"[Math.floor(16 * Math.random())];
        return yt(pt(Number(t)))
    }
    var wt = null;
    function bt() {
        var t = wt;
        if (t) {
            if (4 != +t.readyState)
                return new XMLHttpRequest
        } else
            t = new XMLHttpRequest, wt = t;
        return t
    }
    function Et(t, e) {
        for (var i = 0, n = t.length; i < n; i++)
            if (t[i] === e) {
                t.splice(i, 1);
                break
            }
    }
    function kt(t, e, i) {
        var n = t.length;
        if (!(e >= n || 0 === i)) {
            for (var r = n - (i = e + i > n ? n - e : i), s = e; s < r; ++s)
                t[s] = t[s + i];
            t.length = r
        }
    }
    function St(t) {
        var e = st.exec(t),
        i = {};
        return e && (i[e[1]] = Math.round(parseFloat(e[3])), i[e[5]] = Math.round(parseFloat(e[7]))),
        i
    }
    function Ct(t) {
        var e = nt.exec(t);
        if (e)
            return e[1].toLowerCase()
    }
    function Ot(t) {
        var e = rt.exec(t);
        if (e)
            return {
                mediaType: e[1] ? e[1].toLowerCase() : void 0,
                subType: e[2] ? e[2].toLowerCase() : void 0,
                charset: e[3] ? e[3].toLowerCase() : void 0,
                encoding: e[4] ? e[4].toLowerCase() : void 0,
                data: e[5]
            }
    }
    function Pt(t, e) {
        var i = at.exec(t);
        return i ? parseFloat(i[1]) : void 0 !== e ? e : 1
    }
    function Mt(t, e) {
        return {
            x: t,
            y: void 0 === e ? t : e
        }
    }
    function At(t, e) {
        return {
            scaleX: t,
            scaleY: void 0 === e ? t : e
        }
    }
    function It(t, e, i) {
        return {
            colorR: ct(t) ? 255 : t,
            colorG: ct(e) ? 255 : e,
            colorB: ct(i) ? 255 : i
        }
    }
    var Rt = {
        UNKNOWN: 0,
        WEBGL: 1,
        CANVAS: 2
    },
    Dt = {
        NORMAL: 0,
        ADD: 1,
        MULTIPLY: 2,
        SCREEN: 3,
        OVERLAY: 4,
        DARKEN: 5,
        LIGHTEN: 6,
        COLOR_DODGE: 7,
        COLOR_BURN: 8,
        HARD_LIGHT: 9,
        SOFT_LIGHT: 10,
        DIFFERENCE: 11,
        EXCLUSION: 12,
        HUE: 13,
        SATURATION: 14,
        COLOR: 15,
        LUMINOSITY: 16,
        NORMAL_NPM: 17,
        ADD_NPM: 18,
        SCREEN_NPM: 19
    },
    Lt = {
        POINTS: 0,
        LINES: 1,
        LINE_LOOP: 2,
        LINE_STRIP: 3,
        TRIANGLES: 4,
        TRIANGLE_STRIP: 5,
        TRIANGLE_FAN: 6
    },
    Ft = {
        LINEAR: 0,
        NEAREST: 1
    },
    Nt = {
        CLAMP: 0,
        REPEAT: 1,
        MIRRORED_REPEAT: 2
    },
    Ut = {
        AUTO: 0,
        MANUAL: 1
    },
    Bt = {
        POLY: 0,
        RECT: 1,
        CIRC: 2,
        ELIP: 3,
        RREC: 4
    },
    Xt = {
        STATIC: 0,
        DYNAMIC: 1
    },
    jt = {
        LINEAR_VERTICAL: 0,
        LINEAR_HORIZONTAL: 1
    },
    Gt = {
        INTERACTION: 50,
        HIGH: 25,
        NORMAL: 0,
        LOW: -25,
        UTILITY: -50
    },
    Wt = {
        width: 0,
        height: 0
    },
    Yt = function () {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
            p(this, t),
            this.x = e,
            this.y = i
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.x, this.y)
                    }
                }, {
                    key: "copy",
                    value: function (t) {
                        this.set(t.x, t.y)
                    }
                }, {
                    key: "equals",
                    value: function (t) {
                        return t.x === this.x && t.y === this.y
                    }
                }, {
                    key: "set",
                    value: function (t, e) {
                        this.x = t || 0,
                        this.y = e || (0 !== e ? this.x : 0)
                    }
                }
            ]),
        t
    }
    (),
    Ht = function () {
        function t(e, i) {
            var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
            p(this, t),
            this._x = n,
            this._y = r,
            this.cb = e,
            this.scope = i
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,
                        i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
                        return new t(e || this.cb, i || this.scope, this._x, this._y)
                    }
                }, {
                    key: "set",
                    value: function (t, e) {
                        var i = t || 0,
                        n = e || (0 !== e ? i : 0);
                        this._x === i && this._y === n || (this._x = i, this._y = n, this.cb.call(this.scope))
                    }
                }, {
                    key: "copy",
                    value: function (t) {
                        this._x === t.x && this._y === t.y || (this._x = t.x, this._y = t.y, this.cb.call(this.scope))
                    }
                }, {
                    key: "equals",
                    value: function (t) {
                        return t.x === this._x && t.y === this._y
                    }
                }, {
                    key: "x",
                    get: function () {
                        return this._x
                    },
                    set: function (t) {
                        this._x !== t && (this._x = t, this.cb.call(this.scope))
                    }
                }, {
                    key: "y",
                    get: function () {
                        return this._y
                    },
                    set: function (t) {
                        this._y !== t && (this._y = t, this.cb.call(this.scope))
                    }
                }
            ]),
        t
    }
    (),
    Vt = function () {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1,
            s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0,
            a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0;
            p(this, t),
            this.a = e,
            this.b = i,
            this.c = n,
            this.d = r,
            this.tx = s,
            this.ty = a,
            this.array = null
        }
        return g(t, [{
                    key: "fromArray",
                    value: function (t) {
                        this.a = t[0],
                        this.b = t[1],
                        this.c = t[3],
                        this.d = t[4],
                        this.tx = t[2],
                        this.ty = t[5]
                    }
                }, {
                    key: "set",
                    value: function (t, e, i, n, r, s) {
                        return this.a = t,
                        this.b = e,
                        this.c = i,
                        this.d = n,
                        this.tx = r,
                        this.ty = s,
                        this
                    }
                }, {
                    key: "toArray",
                    value: function (t, e) {
                        this.array || (this.array = new Float32Array(9));
                        var i = e || this.array;
                        return t ? (i[0] = this.a, i[1] = this.b, i[2] = 0, i[3] = this.c, i[4] = this.d, i[5] = 0, i[6] = this.tx, i[7] = this.ty, i[8] = 1) : (i[0] = this.a, i[1] = this.c, i[2] = this.tx, i[3] = this.b, i[4] = this.d, i[5] = this.ty, i[6] = 0, i[7] = 0, i[8] = 1),
                        i
                    }
                }, {
                    key: "apply",
                    value: function (t, e) {
                        e = e || new Yt;
                        var i = t.x,
                        n = t.y;
                        return e.x = this.a * i + this.c * n + this.tx,
                        e.y = this.b * i + this.d * n + this.ty,
                        e
                    }
                }, {
                    key: "applyInverse",
                    value: function (t, e) {
                        e = e || new Yt;
                        var i = 1 / (this.a * this.d + this.c * -this.b),
                        n = t.x,
                        r = t.y;
                        return e.x = this.d * i * n + -this.c * i * r + (this.ty * this.c - this.tx * this.d) * i,
                        e.y = this.a * i * r + -this.b * i * n + (-this.ty * this.a + this.tx * this.b) * i,
                        e
                    }
                }, {
                    key: "translate",
                    value: function (t, e) {
                        return this.tx += t,
                        this.ty += e,
                        this
                    }
                }, {
                    key: "scale",
                    value: function (t, e) {
                        return this.a *= t,
                        this.d *= e,
                        this.c *= t,
                        this.b *= e,
                        this.tx *= t,
                        this.ty *= e,
                        this
                    }
                }, {
                    key: "rotate",
                    value: function (t) {
                        var e = Math.cos(t),
                        i = Math.sin(t),
                        n = this.a,
                        r = this.c,
                        s = this.tx;
                        return this.a = n * e - this.b * i,
                        this.b = n * i + this.b * e,
                        this.c = r * e - this.d * i,
                        this.d = r * i + this.d * e,
                        this.tx = s * e - this.ty * i,
                        this.ty = s * i + this.ty * e,
                        this
                    }
                }, {
                    key: "append",
                    value: function (t) {
                        var e = this.a,
                        i = this.b,
                        n = this.c,
                        r = this.d;
                        return this.a = t.a * e + t.b * n,
                        this.b = t.a * i + t.b * r,
                        this.c = t.c * e + t.d * n,
                        this.d = t.c * i + t.d * r,
                        this.tx = t.tx * e + t.ty * n + this.tx,
                        this.ty = t.tx * i + t.ty * r + this.ty,
                        this
                    }
                }, {
                    key: "setTransform",
                    value: function (t, e, i, n, r, s, a, o, h) {
                        return this.a = Math.cos(a + h) * r,
                        this.b = Math.sin(a + h) * r,
                        this.c = -Math.sin(a - o) * s,
                        this.d = Math.cos(a - o) * s,
                        this.tx = t - (i * this.a + n * this.c),
                        this.ty = e - (i * this.b + n * this.d),
                        this
                    }
                }, {
                    key: "prepend",
                    value: function (t) {
                        var e = this.tx;
                        if (1 !== t.a || 0 !== t.b || 0 !== t.c || 1 !== t.d) {
                            var i = this.a,
                            n = this.c;
                            this.a = i * t.a + this.b * t.c,
                            this.b = i * t.b + this.b * t.d,
                            this.c = n * t.a + this.d * t.c,
                            this.d = n * t.b + this.d * t.d
                        }
                        return this.tx = e * t.a + this.ty * t.c + t.tx,
                        this.ty = e * t.b + this.ty * t.d + t.ty,
                        this
                    }
                }, {
                    key: "decompose",
                    value: function (t) {
                        var e = this.a,
                        i = this.b,
                        n = this.c,
                        r = this.d,
                        s = -Math.atan2(-n, r),
                        a = Math.atan2(i, e),
                        o = Math.abs(s + a);
                        return o < 1e-5 || Math.abs(tt - o) < 1e-5 ? (t.rotation = a, e < 0 && r >= 0 && (t.rotation += t.rotation <= 0 ? Math.PI : -Math.PI), t.skew.x = t.skew.y = 0) : (t.rotation = 0, t.skew.x = s, t.skew.y = a),
                        t.scale.x = Math.sqrt(e * e + i * i),
                        t.scale.y = Math.sqrt(n * n + r * r),
                        t.position.x = this.tx,
                        t.position.y = this.ty,
                        t
                    }
                }, {
                    key: "invert",
                    value: function () {
                        var t = this.a,
                        e = this.b,
                        i = this.c,
                        n = this.d,
                        r = this.tx,
                        s = t * n - e * i;
                        return this.a = n / s,
                        this.b = -e / s,
                        this.c = -i / s,
                        this.d = t / s,
                        this.tx = (i * this.ty - n * r) / s,
                        this.ty =  - (t * this.ty - e * r) / s,
                        this
                    }
                }, {
                    key: "identity",
                    value: function () {
                        return this.a = 1,
                        this.b = 0,
                        this.c = 0,
                        this.d = 1,
                        this.tx = 0,
                        this.ty = 0,
                        this
                    }
                }, {
                    key: "clone",
                    value: function () {
                        var e = new t;
                        return e.a = this.a,
                        e.b = this.b,
                        e.c = this.c,
                        e.d = this.d,
                        e.tx = this.tx,
                        e.ty = this.ty,
                        e
                    }
                }, {
                    key: "copy",
                    value: function (t) {
                        return t.a = this.a,
                        t.b = this.b,
                        t.c = this.c,
                        t.d = this.d,
                        t.tx = this.tx,
                        t.ty = this.ty,
                        t
                    }
                }
            ], [{
                    key: "IDENTITY",
                    get: function () {
                        return new t
                    }
                }, {
                    key: "TEMP_MATRIX",
                    get: function () {
                        return new t
                    }
                }
            ]),
        t
    }
    (),
    zt = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1],
    qt = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1],
    Kt = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1],
    Zt = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1],
    Jt = [],
    Qt = [];
    function $t(t) {
        return t < 0 ? -1 : t > 0 ? 1 : 0
    }
    !function () {
        for (var t = 0; t < 16; t++) {
            var e = [];
            Qt.push(e);
            for (var i = 0; i < 16; i++)
                for (var n = $t(zt[t] * zt[i] + Kt[t] * qt[i]), r = $t(qt[t] * zt[i] + Zt[t] * qt[i]), s = $t(zt[t] * Kt[i] + Kt[t] * Zt[i]), a = $t(qt[t] * Kt[i] + Zt[t] * Zt[i]), o = 0; o < 16; o++)
                    if (zt[o] === n && qt[o] === r && Kt[o] === s && Zt[o] === a) {
                        e.push(o);
                        break
                    }
        }
        for (var h = 0; h < 16; h++) {
            var u = new Vt;
            u.set(zt[h], qt[h], Kt[h], Zt[h], 0, 0),
            Jt.push(u)
        }
    }
    ();
    var te = {
        E: 0,
        SE: 1,
        S: 2,
        SW: 3,
        W: 4,
        NW: 5,
        N: 6,
        NE: 7,
        MIRROR_VERTICAL: 8,
        MIRROR_HORIZONTAL: 12,
        uX: function (t) {
            return zt[t]
        },
        uY: function (t) {
            return qt[t]
        },
        vX: function (t) {
            return Kt[t]
        },
        vY: function (t) {
            return Zt[t]
        },
        inv: function (t) {
            return 8 & t ? 15 & t : 7 & -t
        },
        add: function (t, e) {
            return Qt[t][e]
        },
        sub: function (t, e) {
            return Qt[t][te.inv(e)]
        },
        rotate180: function (t) {
            return 4 ^ t
        },
        isVertical: function (t) {
            return 2 == (3 & t)
        },
        byDirection: function (t, e) {
            return 2 * Math.abs(t) <= Math.abs(e) ? e >= 0 ? te.S : te.N : 2 * Math.abs(e) <= Math.abs(t) ? t > 0 ? te.E : te.W : e > 0 ? t > 0 ? te.SE : te.SW : t > 0 ? te.NE : te.NW
        },
        matrixAppendRotationInv: function (t, e) {
            var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
            r = Jt[te.inv(e)];
            r.tx = i,
            r.ty = n,
            t.append(r)
        }
    },
    ee = function () {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
            p(this, t),
            this.x = Number(e),
            this.y = Number(i),
            this.width = Number(n),
            this.height = Number(r),
            this.type = Bt.RECT
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.x, this.y, this.width, this.height)
                    }
                }, {
                    key: "copy",
                    value: function (t) {
                        return this.x = t.x,
                        this.y = t.y,
                        this.width = t.width,
                        this.height = t.height,
                        this
                    }
                }, {
                    key: "contains",
                    value: function (t, e) {
                        return !(this.width <= 0 || this.height <= 0) && (t >= this.x && t < this.x + this.width && e >= this.y && e < this.y + this.height)
                    }
                }, {
                    key: "pad",
                    value: function (t, e) {
                        t = t || 0,
                        e = e || (0 !== e ? t : 0),
                        this.x -= t,
                        this.y -= e,
                        this.width += 2 * t,
                        this.height += 2 * e
                    }
                }, {
                    key: "fit",
                    value: function (t) {
                        this.x < t.x && (this.width += this.x, this.width < 0 && (this.width = 0), this.x = t.x),
                        this.y < t.y && (this.height += this.y, this.height < 0 && (this.height = 0), this.y = t.y),
                        this.x + this.width > t.x + t.width && (this.width = t.width - this.x, this.width < 0 && (this.width = 0)),
                        this.y + this.height > t.y + t.height && (this.height = t.height - this.y, this.height < 0 && (this.height = 0))
                    }
                }, {
                    key: "enlarge",
                    value: function (t) {
                        var e = Math.min(this.x, t.x),
                        i = Math.max(this.x + this.width, t.x + t.width),
                        n = Math.min(this.y, t.y),
                        r = Math.max(this.y + this.height, t.y + t.height);
                        this.x = e,
                        this.width = i - e,
                        this.y = n,
                        this.height = r - n
                    }
                }, {
                    key: "left",
                    get: function () {
                        return this.x
                    }
                }, {
                    key: "right",
                    get: function () {
                        return this.x + this.width
                    }
                }, {
                    key: "top",
                    get: function () {
                        return this.y
                    }
                }, {
                    key: "bottom",
                    get: function () {
                        return this.y + this.height
                    }
                }
            ], [{
                    key: "EMPTY",
                    get: function () {
                        return new t(0, 0, 0, 0)
                    }
                }
            ]),
        t
    }
    (),
    ie = function () {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
            p(this, t),
            this.x = e,
            this.y = i,
            this.radius = n,
            this.type = Bt.CIRC
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.x, this.y, this.radius)
                    }
                }, {
                    key: "contains",
                    value: function (t, e) {
                        if (this.radius <= 0)
                            return !1;
                        var i = this.radius * this.radius,
                        n = this.x - t,
                        r = this.y - e;
                        return (n *= n) + (r *= r) <= i
                    }
                }, {
                    key: "getBounds",
                    value: function () {
                        return new ee(this.x - this.radius, this.y - this.radius, 2 * this.radius, 2 * this.radius)
                    }
                }
            ]),
        t
    }
    (),
    ne = function () {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0;
            p(this, t),
            this.x = e,
            this.y = i,
            this.width = n,
            this.height = r,
            this.type = Bt.ELIP
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.x, this.y, this.width, this.height)
                    }
                }, {
                    key: "contains",
                    value: function (t, e) {
                        if (this.width <= 0 || this.height <= 0)
                            return !1;
                        var i = (t - this.x) / this.width,
                        n = (e - this.y) / this.height;
                        return (i *= i) + (n *= n) <= 1
                    }
                }, {
                    key: "getBounds",
                    value: function () {
                        return new ee(this.x - this.width, this.y - this.height, this.width, this.height)
                    }
                }
            ]),
        t
    }
    (),
    re = function () {
        function t() {
            for (var e = arguments.length, i = Array(e), n = 0; n < e; n++)
                i[n] = arguments[n];
            if (p(this, t), Array.isArray(i[0]) && (i = i[0]), i[0]instanceof Yt) {
                for (var r = [], s = 0, a = i.length; s < a; s++)
                    r.push(i[s].x, i[s].y);
                i = r
            }
            this.closed = !0,
            this.points = i,
            this.type = Bt.POLY
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.points.slice())
                    }
                }, {
                    key: "close",
                    value: function () {
                        var t = this.points;
                        t[0] === t[t.length - 2] && t[1] === t[t.length - 1] || t.push(t[0], t[1])
                    }
                }, {
                    key: "contains",
                    value: function (t, e) {
                        for (var i = !1, n = this.points.length / 2, r = 0, s = n - 1; r < n; s = r++) {
                            var a = this.points[2 * r],
                            o = this.points[2 * r + 1],
                            h = this.points[2 * s],
                            u = this.points[2 * s + 1];
                            o > e != u > e && t < (e - o) / (u - o) * (h - a) + a && (i = !i)
                        }
                        return i
                    }
                }
            ]),
        t
    }
    (),
    se = function () {
        function t() {
            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0,
            s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 20;
            p(this, t),
            this.x = e,
            this.y = i,
            this.width = n,
            this.height = r,
            this.radius = s,
            this.type = Bt.RREC
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.x, this.y, this.width, this.height, this.radius)
                    }
                }, {
                    key: "contains",
                    value: function (t, e) {
                        if (this.width <= 0 || this.height <= 0)
                            return !1;
                        if (t >= this.x && t <= this.x + this.width && e >= this.y && e <= this.y + this.height) {
                            if (e >= this.y + this.radius && e <= this.y + this.height - this.radius || t >= this.x + this.radius && t <= this.x + this.width - this.radius)
                                return !0;
                            var i = t - (this.x + this.radius),
                            n = e - (this.y + this.radius),
                            r = this.radius * this.radius;
                            if (i * i + n * n <= r)
                                return !0;
                            if ((i = t - (this.x + this.width - this.radius)) * i + n * n <= r)
                                return !0;
                            if (i * i + (n = e - (this.y + this.height - this.radius)) * n <= r)
                                return !0;
                            if ((i = t - (this.x + this.radius)) * i + n * n <= r)
                                return !0
                        }
                        return !1
                    }
                }
            ]),
        t
    }
    ();
    var ae = {
        mixin: function (t) {
            !function (t) {
                t.__plugins = {},
                t.registerPlugin = function (e, i) {
                    t.__plugins[e] = i
                },
                t.prototype.initPlugins = function () {
                    for (var e in this.plugins = this.plugins || {}, t.__plugins)
                        this.plugins[e] = new t.__plugins[e](this)
                },
                t.prototype.destroyPlugins = function () {
                    for (var t in this.plugins)
                        this.plugins[t].destroy(), this.plugins[t] = null;
                    this.plugins = null
                }
            }
            (t)
        }
    };
    var oe = ue,
    he = ue;
    function ue(t, e, i) {
        i = i || 2;
        var n,
        r,
        s,
        a,
        o,
        h,
        u,
        l = e && e.length,
        c = l ? e[0] * i : t.length,
        d = le(t, 0, c, i, !0),
        f = [];
        if (!d || d.next === d.prev)
            return f;
        if (l && (d = function (t, e, i, n) {
                var r,
                s,
                a,
                o,
                h,
                u = [];
                for (r = 0, s = e.length; r < s; r++)
                    a = e[r] * n, o = r < s - 1 ? e[r + 1] * n : t.length, (h = le(t, a, o, n, !1))
                         === h.next && (h.steiner = !0), u.push(Te(h));
                    for (u.sort(ye), r = 0; r < u.length; r++)
                        _e(u[r], i), i = ce(i, i.next);
                    return i
                }
                    (t, e, d, i)), t.length > 80 * i) {
                n = s = t[0],
                r = a = t[1];
                for (var v = i; v < c; v += i)
                    o = t[v], h = t[v + 1], o < n && (n = o), h < r && (r = h), o > s && (s = o), h > a && (a = h);
                u = 0 !== (u = Math.max(s - n, a - r)) ? 1 / u : 0
            }
        return de(d, f, i, n, r, u),
        f
    }
    function le(t, e, i, n, r) {
        var s,
        a;
        if (r === De(t, e, i, n) > 0)
            for (s = e; s < i; s += n)
                a = Ae(s, t[s], t[s + 1], a);
        else
            for (s = i - n; s >= e; s -= n)
                a = Ae(s, t[s], t[s + 1], a);
        return a && ke(a, a.next) && (Ie(a), a = a.next),
        a
    }
    function ce(t, e) {
        if (!t)
            return t;
        e || (e = t);
        var i,
        n = t;
        do {
            if (i = !1, n.steiner || !ke(n, n.next) && 0 !== Ee(n.prev, n, n.next))
                n = n.next;
            else {
                if (Ie(n), (n = e = n.prev) === n.next)
                    break;
                i = !0
            }
        } while (i || n !== e);
        return e
    }
    function de(t, e, i, n, r, s, a) {
        if (t) {
            !a && s && function (t, e, i, n) {
                var r = t;
                do {
                    null === r.z && (r.z = xe(r.x, r.y, e, i, n)),
                    r.prevZ = r.prev,
                    r.nextZ = r.next,
                    r = r.next
                } while (r !== t);
                r.prevZ.nextZ = null,
                r.prevZ = null,
                function (t) {
                    var e,
                    i,
                    n,
                    r,
                    s,
                    a,
                    o,
                    h,
                    u = 1;
                    do {
                        for (i = t, t = null, s = null, a = 0; i; ) {
                            for (a++, n = i, o = 0, e = 0; e < u && (o++, n = n.nextZ); e++);
                            for (h = u; o > 0 || h > 0 && n; )
                                0 !== o && (0 === h || !n || i.z <= n.z) ? (r = i, i = i.nextZ, o--) : (r = n, n = n.nextZ, h--), s ? s.nextZ = r : t = r, r.prevZ = s, s = r;
                            i = n
                        }
                        s.nextZ = null,
                        u *= 2
                    } while (a > 1)
                }
                (r)
            }
            (t, n, r, s);
            for (var o, h, u = t; t.prev !== t.next; )
                if (o = t.prev, h = t.next, s ? ve(t, n, r, s) : fe(t))
                    e.push(o.i / i), e.push(t.i / i), e.push(h.i / i), Ie(t), t = h.next, u = h.next;
                else if ((t = h) === u) {
                    a ? 1 === a ? de(t = pe(ce(t), e, i), e, i, n, r, s, 2) : 2 === a && ge(t, e, i, n, r, s) : de(ce(t), e, i, n, r, s, 1);
                    break
                }
        }
    }
    function fe(t) {
        var e = t.prev,
        i = t,
        n = t.next;
        if (Ee(e, i, n) >= 0)
            return !1;
        for (var r = t.next.next; r !== t.prev; ) {
            if (we(e.x, e.y, i.x, i.y, n.x, n.y, r.x, r.y) && Ee(r.prev, r, r.next) >= 0)
                return !1;
            r = r.next
        }
        return !0
    }
    function ve(t, e, i, n) {
        var r = t.prev,
        s = t,
        a = t.next;
        if (Ee(r, s, a) >= 0)
            return !1;
        for (var o = r.x < s.x ? r.x < a.x ? r.x : a.x : s.x < a.x ? s.x : a.x, h = r.y < s.y ? r.y < a.y ? r.y : a.y : s.y < a.y ? s.y : a.y, u = r.x > s.x ? r.x > a.x ? r.x : a.x : s.x > a.x ? s.x : a.x, l = r.y > s.y ? r.y > a.y ? r.y : a.y : s.y > a.y ? s.y : a.y, c = xe(o, h, e, i, n), d = xe(u, l, e, i, n), f = t.prevZ, v = t.nextZ; f && f.z >= c && v && v.z <= d; ) {
            if (f !== t.prev && f !== t.next && we(r.x, r.y, s.x, s.y, a.x, a.y, f.x, f.y) && Ee(f.prev, f, f.next) >= 0)
                return !1;
            if (f = f.prevZ, v !== t.prev && v !== t.next && we(r.x, r.y, s.x, s.y, a.x, a.y, v.x, v.y) && Ee(v.prev, v, v.next) >= 0)
                return !1;
            v = v.nextZ
        }
        for (; f && f.z >= c; ) {
            if (f !== t.prev && f !== t.next && we(r.x, r.y, s.x, s.y, a.x, a.y, f.x, f.y) && Ee(f.prev, f, f.next) >= 0)
                return !1;
            f = f.prevZ
        }
        for (; v && v.z <= d; ) {
            if (v !== t.prev && v !== t.next && we(r.x, r.y, s.x, s.y, a.x, a.y, v.x, v.y) && Ee(v.prev, v, v.next) >= 0)
                return !1;
            v = v.nextZ
        }
        return !0
    }
    function pe(t, e, i) {
        var n = t;
        do {
            var r = n.prev,
            s = n.next.next;
            !ke(r, s) && Se(r, n, n.next, s) && Pe(r, s) && Pe(s, r) && (e.push(r.i / i), e.push(n.i / i), e.push(s.i / i), Ie(n), Ie(n.next), n = t = s),
            n = n.next
        } while (n !== t);
        return ce(n)
    }
    function ge(t, e, i, n, r, s) {
        var a = t;
        do {
            for (var o = a.next.next; o !== a.prev; ) {
                if (a.i !== o.i && be(a, o)) {
                    var h = Me(a, o);
                    return a = ce(a, a.next),
                    h = ce(h, h.next),
                    de(a, e, i, n, r, s),
                    void de(h, e, i, n, r, s)
                }
                o = o.next
            }
            a = a.next
        } while (a !== t)
    }
    function ye(t, e) {
        return t.x - e.x
    }
    function _e(t, e) {
        if (e = function (t, e) {
            var i,
            n = e,
            r = t.x,
            s = t.y,
            a = -1 / 0;
            do {
                if (s <= n.y && s >= n.next.y && n.next.y !== n.y) {
                    var o = n.x + (s - n.y) * (n.next.x - n.x) / (n.next.y - n.y);
                    if (o <= r && o > a) {
                        if (a = o, o === r) {
                            if (s === n.y)
                                return n;
                            if (s === n.next.y)
                                return n.next
                        }
                        i = n.x < n.next.x ? n : n.next
                    }
                }
                n = n.next
            } while (n !== e);
            if (!i)
                return null;
            if (r === a)
                return i;
            var h,
            u = i,
            l = i.x,
            c = i.y,
            d = 1 / 0;
            n = i;
            do {
                r >= n.x && n.x >= l && r !== n.x && we(s < c ? r : a, s, l, c, s < c ? a : r, s, n.x, n.y) && (h = Math.abs(s - n.y) / (r - n.x), Pe(n, t) && (h < d || h === d && (n.x > i.x || n.x === i.x && me(i, n))) && (i = n, d = h)),
                n = n.next
            } while (n !== u);
            return i
        }
            (t, e)) {
            var i = Me(e, t);
            ce(i, i.next)
        }
    }
    function me(t, e) {
        return Ee(t.prev, t, e.prev) < 0 && Ee(e.next, t, t.next) < 0
    }
    function xe(t, e, i, n, r) {
        return (t = 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = 32767 * (t - i) * r) | t << 8)) | t << 4)) | t << 2)) | t << 1)) | (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e = 16711935 & ((e = 32767 * (e - n) * r) | e << 8)) | e << 4)) | e << 2)) | e << 1)) << 1
    }
    function Te(t) {
        var e = t,
        i = t;
        do {
            (e.x < i.x || e.x === i.x && e.y < i.y) && (i = e),
            e = e.next
        } while (e !== t);
        return i
    }
    function we(t, e, i, n, r, s, a, o) {
        return (r - a) * (e - o) - (t - a) * (s - o) >= 0 && (t - a) * (n - o) - (i - a) * (e - o) >= 0 && (i - a) * (s - o) - (r - a) * (n - o) >= 0
    }
    function be(t, e) {
        return t.next.i !== e.i && t.prev.i !== e.i && !function (t, e) {
            var i = t;
            do {
                if (i.i !== t.i && i.next.i !== t.i && i.i !== e.i && i.next.i !== e.i && Se(i, i.next, t, e))
                    return !0;
                i = i.next
            } while (i !== t);
            return !1
        }
        (t, e) && (Pe(t, e) && Pe(e, t) && function (t, e) {
            var i = t,
            n = !1,
            r = (t.x + e.x) / 2,
            s = (t.y + e.y) / 2;
            do {
                i.y > s != i.next.y > s && i.next.y !== i.y && r < (i.next.x - i.x) * (s - i.y) / (i.next.y - i.y) + i.x && (n = !n),
                i = i.next
            } while (i !== t);
            return n
        }
            (t, e) && (Ee(t.prev, t, e.prev) || Ee(t, e.prev, e)) || ke(t, e) && Ee(t.prev, t, t.next) > 0 && Ee(e.prev, e, e.next) > 0)
    }
    function Ee(t, e, i) {
        return (e.y - t.y) * (i.x - e.x) - (e.x - t.x) * (i.y - e.y)
    }
    function ke(t, e) {
        return t.x === e.x && t.y === e.y
    }
    function Se(t, e, i, n) {
        var r = Oe(Ee(t, e, i)),
        s = Oe(Ee(t, e, n)),
        a = Oe(Ee(i, n, t)),
        o = Oe(Ee(i, n, e));
        return r !== s && a !== o || (!(0 !== r || !Ce(t, i, e)) || (!(0 !== s || !Ce(t, n, e)) || (!(0 !== a || !Ce(i, t, n)) || !(0 !== o || !Ce(i, e, n)))))
    }
    function Ce(t, e, i) {
        return e.x <= Math.max(t.x, i.x) && e.x >= Math.min(t.x, i.x) && e.y <= Math.max(t.y, i.y) && e.y >= Math.min(t.y, i.y)
    }
    function Oe(t) {
        return t > 0 ? 1 : t < 0 ? -1 : 0
    }
    function Pe(t, e) {
        return Ee(t.prev, t, t.next) < 0 ? Ee(t, e, t.next) >= 0 && Ee(t, t.prev, e) >= 0 : Ee(t, e, t.prev) < 0 || Ee(t, t.next, e) < 0
    }
    function Me(t, e) {
        var i = new Re(t.i, t.x, t.y),
        n = new Re(e.i, e.x, e.y),
        r = t.next,
        s = e.prev;
        return t.next = e,
        e.prev = t,
        i.next = r,
        r.prev = i,
        n.next = i,
        i.prev = n,
        s.next = n,
        n.prev = s,
        n
    }
    function Ae(t, e, i, n) {
        var r = new Re(t, e, i);
        return n ? (r.next = n.next, r.prev = n, n.next.prev = r, n.next = r) : (r.prev = r, r.next = r),
        r
    }
    function Ie(t) {
        t.next.prev = t.prev,
        t.prev.next = t.next,
        t.prevZ && (t.prevZ.nextZ = t.nextZ),
        t.nextZ && (t.nextZ.prevZ = t.prevZ)
    }
    function Re(t, e, i) {
        this.i = t,
        this.x = e,
        this.y = i,
        this.prev = null,
        this.next = null,
        this.z = null,
        this.prevZ = null,
        this.nextZ = null,
        this.steiner = !1
    }
    function De(t, e, i, n) {
        for (var r = 0, s = e, a = i - n; s < i; s += n)
            r += (t[a] - t[s]) * (t[s + 1] + t[a + 1]), a = s;
        return r
    }
    function Le(t) {
        return t.x + t.width
    }
    function Fe(t) {
        return t.x
    }
    function Ne(t) {
        return t.y + t.height
    }
    function Ue(t) {
        return t.y
    }
    ue.deviation = function (t, e, i, n) {
        var r = e && e.length,
        s = r ? e[0] * i : t.length,
        a = Math.abs(De(t, 0, s, i));
        if (r)
            for (var o = 0, h = e.length; o < h; o++) {
                var u = e[o] * i,
                l = o < h - 1 ? e[o + 1] * i : t.length;
                a -= Math.abs(De(t, u, l, i))
            }
        var c = 0;
        for (o = 0; o < n.length; o += 3) {
            var d = n[o] * i,
            f = n[o + 1] * i,
            v = n[o + 2] * i;
            c += Math.abs((t[d] - t[v]) * (t[f + 1] - t[d + 1]) - (t[d] - t[f]) * (t[v + 1] - t[d + 1]))
        }
        return 0 === a && 0 === c ? 0 : Math.abs((c - a) / a)
    },
    ue.flatten = function (t) {
        for (var e = t[0][0].length, i = {
                vertices: [],
                holes: [],
                dimensions: e
            }, n = 0, r = 0; r < t.length; r++) {
            for (var s = 0; s < t[r].length; s++)
                for (var a = 0; a < e; a++)
                    i.vertices.push(t[r][s][a]);
            r > 0 && (n += t[r - 1].length, i.holes.push(n))
        }
        return i
    },
    oe.default = he;
    var Be = 0;
    function Xe() {
        return ++Be
    }
    function je() {
        var t = {
            stencil: !0,
            failIfMajorPerformanceCaveat: !0
        };
        try {
            if (!window.WebGLRenderingContext)
                return !1;
            var e = document.createElement("canvas"),
            i = e.getContext("webgl", t) || e.getContext("experimental-webgl", t),
            n = !(!i || !i.getContextAttributes().stencil);
            if (i) {
                var r = i.getExtension("WEBGL_lose_context");
                r && r.loseContext()
            }
            return i = null,
            n
        } catch (t) {
            return !1
        }
    }
    var Ge = Object.create(null),
    We = Object.create(null),
    Ye = [];
    var He = function () {
        for (var t = [], e = [], i = 0; i < 32; i++)
            t[i] = i, e[i] = i;
        t[Dt.NORMAL_NPM] = Dt.NORMAL,
        t[Dt.ADD_NPM] = Dt.ADD,
        t[Dt.SCREEN_NPM] = Dt.SCREEN,
        e[Dt.NORMAL] = Dt.NORMAL_NPM,
        e[Dt.ADD] = Dt.ADD_NPM,
        e[Dt.SCREEN] = Dt.SCREEN_NPM;
        var n = [];
        return n.push(e),
        n.push(t),
        n
    }
    ();
    function Ve(t, e) {
        if (1 === e)
            return (255 * e << 24) + t;
        if (0 === e)
            return 0;
        var i = t >> 16 & 255,
        n = t >> 8 & 255,
        r = 255 & t;
        return (255 * e << 24) + ((i = i * e + .5 | 0) << 16) + ((n = n * e + .5 | 0) << 8) + (r = r * e + .5 | 0)
    }
    function ze() {
        t.FrameCount++
    }
    function qe(e) {
        switch (e) {
        case 10:
            return !(t.FrameCount % 6);
        case 20:
            return !(t.FrameCount % 3);
        case 30:
            return !(t.FrameCount % 2);
        case 40:
            return t.FrameCount % 3;
        case 50:
            return t.FrameCount % 6;
        default:
            return !0
        }
    }
    t.FrameCount = 0;
    var Ke,
    Ze = {
        TARGET_FPMS: .06,
        MIPMAP_TEXTURES: !0,
        RESOLUTION: 1,
        FILTER_RESOLUTION: 1,
        SPRITE_MAX_TEXTURES: (Ke = 32, $.tablet || $.phone ? 4 : Ke),
        SPRITE_BATCH_SIZE: 4096,
        RENDER_OPTIONS: {
            view: null,
            antialias: !1,
            autoResize: !1,
            transparent: !1,
            backgroundColor: 0,
            clearBeforeRender: !0,
            preserveDrawingBuffer: !1,
            roundPixels: !1,
            legacy: !1
        },
        TRANSFORM_MODE: 0,
        GC_MODE: 0,
        GC_MAX_IDLE: 3600,
        GC_MAX_CHECK_COUNT: 600,
        WRAP_MODE: 0,
        SCALE_MODE: 0,
        PRECISION_VERTEX: "highp",
        PRECISION_FRAGMENT: "mediump",
        CAN_UPLOAD_SAME_BUFFER: !(navigator.platform && /ipad|iphone|ipod/.test(navigator.platform.toLowerCase()))
    },
    Je = {
        width: null,
        height: null,
        referWidth: 320,
        fixSize: !1,
        canvasId: "TinyCanvas",
        orientation: 0,
        dpi: 1,
        fps: 60,
        showFPS: !1,
        debug: !1,
        viewTouched: !1,
        renderType: 0,
        renderOptions: {},
        extraContextAttributes: {},
        autoRender: 1
    },
    Qe = Object.freeze(Object.assign({}, Je)),
    $e = function () {
        function t(e) {
            var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] && arguments[3];
            p(this, t),
            this.fn = e,
            this.context = i,
            this.priority = n,
            this.once = r,
            this.next = null,
            this.previous = null,
            this._destroyed = !1
        }
        return g(t, [{
                    key: "match",
                    value: function (t, e) {
                        return e = e || null,
                        this.fn === t && this.context === e
                    }
                }, {
                    key: "emit",
                    value: function (t) {
                        this.fn && (this.context ? this.fn.call(this.context, t) : this.fn(t));
                        var e = this.next;
                        return this.once && this.destroy(!0),
                        this._destroyed && (this.next = null),
                        e
                    }
                }, {
                    key: "connect",
                    value: function (t) {
                        this.previous = t,
                        t.next && (t.next.previous = this),
                        this.next = t.next,
                        t.next = this
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                        this._destroyed = !0,
                        this.fn = null,
                        this.context = null,
                        this.previous && (this.previous.next = this.next),
                        this.next && (this.next.previous = this.previous);
                        var e = this.next;
                        return this.next = t ? null : e,
                        this.previous = null,
                        e
                    }
                }
            ]),
        t
    }
    (),
    ti = function () {
        function t() {
            var e = this;
            p(this, t),
            this._head = new $e(null, null, 1 / 0),
            this._requestId = null,
            this._maxElapsedMS = 100,
            this.autoStart = !1,
            this.deltaTime = 1,
            this.elapsedMS = 1 / Ze.TARGET_FPMS,
            this.lastTime = -1,
            this.speed = 1,
            this.started = !1,
            this._tick = function (t) {
                e._requestId = null,
                e.started && (e.update(t), e.started && null === e._requestId && e._head.next && (e._requestId = window.requestAnimationFrame(e._tick)))
            }
        }
        return g(t, [{
                    key: "_requestIfNeeded",
                    value: function () {
                        null === this._requestId && this._head.next && (this.lastTime = window.performance.now(), this._requestId = window.requestAnimationFrame(this._tick))
                    }
                }, {
                    key: "_cancelIfNeeded",
                    value: function () {
                        null !== this._requestId && (window.cancelAnimationFrame(this._requestId), this._requestId = null)
                    }
                }, {
                    key: "_startIfPossible",
                    value: function () {
                        this.started ? this._requestIfNeeded() : this.autoStart && this.start()
                    }
                }, {
                    key: "add",
                    value: function (t, e) {
                        var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Gt.NORMAL;
                        return this._addListener(new $e(t, e, i))
                    }
                }, {
                    key: "addOnce",
                    value: function (t, e) {
                        var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Gt.NORMAL;
                        return this._addListener(new $e(t, e, i, !0))
                    }
                }, {
                    key: "_addListener",
                    value: function (t) {
                        if (t.fn !== ze) {
                            var e = t.fn;
                            t.preFn = e,
                            t.fn = function (t) {
                                qe(Je.fps) && e.call(this, t)
                            }
                        }
                        var i = this._head.next,
                        n = this._head;
                        if (i) {
                            for (; i; ) {
                                if (t.priority > i.priority) {
                                    t.connect(n);
                                    break
                                }
                                n = i,
                                i = i.next
                            }
                            t.previous || t.connect(n)
                        } else
                            t.connect(n);
                        return this._startIfPossible(),
                        this
                    }
                }, {
                    key: "remove",
                    value: function (t, e) {
                        if (ht(t)) {
                            for (var i = this._head.next; i; )
                                t === i.preFn && (i.fn = i.preFn), i = i.match(t, e) ? i.destroy() : i.next;
                            return this._head.next || this._cancelIfNeeded(),
                            this
                        }
                    }
                }, {
                    key: "start",
                    value: function () {
                        this.started || (this.started = !0, this._requestIfNeeded())
                    }
                }, {
                    key: "stop",
                    value: function () {
                        this.started && (this.started = !1, this._cancelIfNeeded())
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        if (this.stop(), this._head) {
                            for (var t = this._head.next; t; )
                                t = t.destroy(!0);
                            this._head.destroy(),
                            this._head = null
                        }
                    }
                }, {
                    key: "update",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window.performance.now(),
                        e = void 0;
                        if (t > this.lastTime) {
                            (e = this.elapsedMS = t - this.lastTime) > this._maxElapsedMS && (e = this._maxElapsedMS),
                            this.deltaTime = e * Ze.TARGET_FPMS * this.speed;
                            for (var i = this._head, n = i.next; n; )
                                n = n.emit(this.deltaTime);
                            i.next || this._cancelIfNeeded()
                        } else
                            this.deltaTime = this.elapsedMS = 0;
                        this.lastTime = t
                    }
                }, {
                    key: "FPS",
                    get: function () {
                        return 1e3 / this.elapsedMS
                    }
                }, {
                    key: "minFPS",
                    get: function () {
                        return 1e3 / this._maxElapsedMS
                    },
                    set: function (t) {
                        var e = Math.min(Math.max(0, t) / 1e3, Ze.TARGET_FPMS);
                        this._maxElapsedMS = 1 / e
                    }
                }
            ]),
        t
    }
    (),
    ei = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return i.duration = t.duration || 1e3,
            i.times = t.times || 1 / 0,
            i.count = 0,
            Ye.push(i),
            i
        }
        return m(e, f),
        g(e, [{
                    key: "start",
                    value: function () {
                        var t = this;
                        if (this._indicate = null, !(this.count >= this.times)) {
                            this.ticker = new ti,
                            this.startTime = ft();
                            this.ticker.add(function (e) {
                                var i = ft();
                                if (t.count >= t.times)
                                    return t.ticker.destroy(), void t.emit("complete", e);
                                i - t.startTime >= t.duration && (t.startTime = i, t.count++, t.emit("update", e))
                            }),
                            this.ticker.start()
                        }
                    }
                }, {
                    key: "pause",
                    value: function (t) {
                        this.ticker.destroy(),
                        t || (this._indicate = "manual pause"),
                        this.emit("pause")
                    }
                }, {
                    key: "stop",
                    value: function (t) {
                        this.ticker.destroy(),
                        this.count = 0,
                        t || (this._indicate = "manual stop"),
                        this.emit("stop")
                    }
                }, {
                    key: "isManualPause",
                    value: function () {
                        return "manual pause" === this._indicate
                    }
                }, {
                    key: "ifManualStop",
                    value: function () {
                        return "manual stop" === this._indicate
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.stop(),
                        Et(Ye, this)
                    }
                }, {
                    key: "running",
                    get: function () {
                        return this.ticker.started
                    }
                }
            ]),
        e
    }
    (),
    ii = new ti;
    ii.autoStart = !0,
    ii.add(ze),
    ii.destroy = function () {};
    var ni = Object.freeze({
        shared: ii,
        Ticker: ti,
        CountDown: ei
    }),
    ri = function () {
        function t() {
            p(this, t),
            this.worldTransform = new Vt,
            this.localTransform = new Vt,
            this._worldID = 0,
            this._parentID = 0
        }
        return g(t, [{
                    key: "updateLocalTransform",
                    value: function () {}
                }, {
                    key: "updateTransform",
                    value: function (t) {
                        var e = t.worldTransform,
                        i = this.worldTransform,
                        n = this.localTransform;
                        i.a = n.a * e.a + n.b * e.c,
                        i.b = n.a * e.b + n.b * e.d,
                        i.c = n.c * e.a + n.d * e.c,
                        i.d = n.c * e.b + n.d * e.d,
                        i.tx = n.tx * e.a + n.ty * e.c + e.tx,
                        i.ty = n.tx * e.b + n.ty * e.d + e.ty,
                        this._worldID++
                    }
                }
            ]),
        t
    }
    ();
    ri.prototype.updateWorldTransform = ri.prototype.updateTransform,
    ri.IDENTITY = new ri;
    var si = function (t) {
        function e() {
            p(this, e);
            var t = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return t.position = new Ht(t.onChange, t, 0, 0),
            t.scale = new Ht(t.onChange, t, 1, 1),
            t.pivot = new Ht(t.onChange, t, 0, 0),
            t.skew = new Ht(t.updateSkew, t, 0, 0),
            t._rotation = 0,
            t._cx = 1,
            t._sx = 0,
            t._cy = 0,
            t._sy = 1,
            t._localID = 0,
            t._currentLocalID = 0,
            t
        }
        return m(e, ri),
        g(e, [{
                    key: "onChange",
                    value: function () {
                        this._localID++
                    }
                }, {
                    key: "updateSkew",
                    value: function () {
                        this._cx = Math.cos(this._rotation + this.skew._y),
                        this._sx = Math.sin(this._rotation + this.skew._y),
                        this._cy = -Math.sin(this._rotation - this.skew._x),
                        this._sy = Math.cos(this._rotation - this.skew._x),
                        this._localID++
                    }
                }, {
                    key: "updateLocalTransform",
                    value: function () {
                        var t = this.localTransform;
                        this._localID !== this._currentLocalID && (t.a = this._cx * this.scale._x, t.b = this._sx * this.scale._x, t.c = this._cy * this.scale._y, t.d = this._sy * this.scale._y, t.tx = this.position._x - (this.pivot._x * t.a + this.pivot._y * t.c), t.ty = this.position._y - (this.pivot._x * t.b + this.pivot._y * t.d), this._currentLocalID = this._localID, this._parentID = -1)
                    }
                }, {
                    key: "updateTransform",
                    value: function (t) {
                        var e = this.localTransform;
                        if (this._localID !== this._currentLocalID && (e.a = this._cx * this.scale._x, e.b = this._sx * this.scale._x, e.c = this._cy * this.scale._y, e.d = this._sy * this.scale._y, e.tx = this.position._x - (this.pivot._x * e.a + this.pivot._y * e.c), e.ty = this.position._y - (this.pivot._x * e.b + this.pivot._y * e.d), this._currentLocalID = this._localID, this._parentID = -1), this._parentID !== t._worldID) {
                            var i = t.worldTransform,
                            n = this.worldTransform;
                            n.a = e.a * i.a + e.b * i.c,
                            n.b = e.a * i.b + e.b * i.d,
                            n.c = e.c * i.a + e.d * i.c,
                            n.d = e.c * i.b + e.d * i.d,
                            n.tx = e.tx * i.a + e.ty * i.c + i.tx,
                            n.ty = e.tx * i.b + e.ty * i.d + i.ty,
                            this._parentID = t._worldID,
                            this._worldID++
                        }
                    }
                }, {
                    key: "setFromMatrix",
                    value: function (t) {
                        t.decompose(this),
                        this._localID++
                    }
                }, {
                    key: "rotation",
                    get: function () {
                        return this._rotation
                    },
                    set: function (t) {
                        this._rotation = t,
                        this.updateSkew()
                    }
                }
            ]),
        e
    }
    (),
    ai = function (t) {
        function e() {
            p(this, e);
            var t = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return t.position = new Yt(0, 0),
            t.scale = new Yt(1, 1),
            t.skew = new Ht(t.updateSkew, t, 0, 0),
            t.pivot = new Yt(0, 0),
            t._rotation = 0,
            t._cx = 1,
            t._sx = 0,
            t._cy = 0,
            t._sy = 1,
            t
        }
        return m(e, ri),
        g(e, [{
                    key: "updateSkew",
                    value: function () {
                        this._cx = Math.cos(this._rotation + this.skew._y),
                        this._sx = Math.sin(this._rotation + this.skew._y),
                        this._cy = -Math.sin(this._rotation - this.skew._x),
                        this._sy = Math.cos(this._rotation - this.skew._x)
                    }
                }, {
                    key: "updateLocalTransform",
                    value: function () {
                        var t = this.localTransform;
                        t.a = this._cx * this.scale.x,
                        t.b = this._sx * this.scale.x,
                        t.c = this._cy * this.scale.y,
                        t.d = this._sy * this.scale.y,
                        t.tx = this.position.x - (this.pivot.x * t.a + this.pivot.y * t.c),
                        t.ty = this.position.y - (this.pivot.x * t.b + this.pivot.y * t.d)
                    }
                }, {
                    key: "updateTransform",
                    value: function (t) {
                        var e = this.localTransform;
                        e.a = this._cx * this.scale.x,
                        e.b = this._sx * this.scale.x,
                        e.c = this._cy * this.scale.y,
                        e.d = this._sy * this.scale.y,
                        e.tx = this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c),
                        e.ty = this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d);
                        var i = t.worldTransform,
                        n = this.worldTransform;
                        n.a = e.a * i.a + e.b * i.c,
                        n.b = e.a * i.b + e.b * i.d,
                        n.c = e.c * i.a + e.d * i.c,
                        n.d = e.c * i.b + e.d * i.d,
                        n.tx = e.tx * i.a + e.ty * i.c + i.tx,
                        n.ty = e.tx * i.b + e.ty * i.d + i.ty,
                        this._worldID++
                    }
                }, {
                    key: "setFromMatrix",
                    value: function (t) {
                        t.decompose(this)
                    }
                }, {
                    key: "rotation",
                    get: function () {
                        return this._rotation
                    },
                    set: function (t) {
                        this._rotation = t,
                        this.updateSkew()
                    }
                }
            ]),
        e
    }
    (),
    oi = function () {
        function t() {
            p(this, t),
            this.minX = 1 / 0,
            this.minY = 1 / 0,
            this.maxX = -1 / 0,
            this.maxY = -1 / 0,
            this.rect = null
        }
        return g(t, [{
                    key: "isEmpty",
                    value: function () {
                        return this.minX > this.maxX || this.minY > this.maxY
                    }
                }, {
                    key: "clear",
                    value: function () {
                        this.updateID++,
                        this.minX = 1 / 0,
                        this.minY = 1 / 0,
                        this.maxX = -1 / 0,
                        this.maxY = -1 / 0
                    }
                }, {
                    key: "getRectangle",
                    value: function (t) {
                        return this.minX > this.maxX || this.minY > this.maxY ? ee.EMPTY : ((t = t || new ee(0, 0, 1, 1)).x = this.minX, t.y = this.minY, t.width = this.maxX - this.minX, t.height = this.maxY - this.minY, t)
                    }
                }, {
                    key: "addPoint",
                    value: function (t) {
                        this.minX = Math.min(this.minX, t.x),
                        this.maxX = Math.max(this.maxX, t.x),
                        this.minY = Math.min(this.minY, t.y),
                        this.maxY = Math.max(this.maxY, t.y)
                    }
                }, {
                    key: "addQuad",
                    value: function (t) {
                        var e = this.minX,
                        i = this.minY,
                        n = this.maxX,
                        r = this.maxY,
                        s = t[0],
                        a = t[1];
                        e = s < e ? s : e,
                        i = a < i ? a : i,
                        n = s > n ? s : n,
                        r = a > r ? a : r,
                        s = t[2],
                        a = t[3],
                        e = s < e ? s : e,
                        i = a < i ? a : i,
                        n = s > n ? s : n,
                        r = a > r ? a : r,
                        s = t[4],
                        a = t[5],
                        e = s < e ? s : e,
                        i = a < i ? a : i,
                        n = s > n ? s : n,
                        r = a > r ? a : r,
                        s = t[6],
                        a = t[7],
                        e = s < e ? s : e,
                        i = a < i ? a : i,
                        n = s > n ? s : n,
                        r = a > r ? a : r,
                        this.minX = e,
                        this.minY = i,
                        this.maxX = n,
                        this.maxY = r
                    }
                }, {
                    key: "addFrame",
                    value: function (t, e, i, n, r) {
                        var s = t.worldTransform,
                        a = s.a,
                        o = s.b,
                        h = s.c,
                        u = s.d,
                        l = s.tx,
                        c = s.ty,
                        d = this.minX,
                        f = this.minY,
                        v = this.maxX,
                        p = this.maxY,
                        g = a * e + h * i + l,
                        y = o * e + u * i + c;
                        d = g < d ? g : d,
                        f = y < f ? y : f,
                        v = g > v ? g : v,
                        p = y > p ? y : p,
                        y = o * n + u * i + c,
                        d = (g = a * n + h * i + l) < d ? g : d,
                        f = y < f ? y : f,
                        v = g > v ? g : v,
                        p = y > p ? y : p,
                        y = o * e + u * r + c,
                        d = (g = a * e + h * r + l) < d ? g : d,
                        f = y < f ? y : f,
                        v = g > v ? g : v,
                        p = y > p ? y : p,
                        y = o * n + u * r + c,
                        d = (g = a * n + h * r + l) < d ? g : d,
                        f = y < f ? y : f,
                        v = g > v ? g : v,
                        p = y > p ? y : p,
                        this.minX = d,
                        this.minY = f,
                        this.maxX = v,
                        this.maxY = p
                    }
                }, {
                    key: "addVertices",
                    value: function (t, e, i, n) {
                        for (var r = t.worldTransform, s = r.a, a = r.b, o = r.c, h = r.d, u = r.tx, l = r.ty, c = this.minX, d = this.minY, f = this.maxX, v = this.maxY, p = i; p < n; p += 2) {
                            var g = e[p],
                            y = e[p + 1],
                            _ = s * g + o * y + u,
                            m = h * y + a * g + l;
                            c = _ < c ? _ : c,
                            d = m < d ? m : d,
                            f = _ > f ? _ : f,
                            v = m > v ? m : v
                        }
                        this.minX = c,
                        this.minY = d,
                        this.maxX = f,
                        this.maxY = v
                    }
                }, {
                    key: "addBounds",
                    value: function (t) {
                        var e = this.minX,
                        i = this.minY,
                        n = this.maxX,
                        r = this.maxY;
                        this.minX = t.minX < e ? t.minX : e,
                        this.minY = t.minY < i ? t.minY : i,
                        this.maxX = t.maxX > n ? t.maxX : n,
                        this.maxY = t.maxY > r ? t.maxY : r
                    }
                }, {
                    key: "addBoundsMask",
                    value: function (t, e) {
                        var i = t.minX > e.minX ? t.minX : e.minX,
                        n = t.minY > e.minY ? t.minY : e.minY,
                        r = t.maxX < e.maxX ? t.maxX : e.maxX,
                        s = t.maxY < e.maxY ? t.maxY : e.maxY;
                        if (i <= r && n <= s) {
                            var a = this.minX,
                            o = this.minY,
                            h = this.maxX,
                            u = this.maxY;
                            this.minX = i < a ? i : a,
                            this.minY = n < o ? n : o,
                            this.maxX = r > h ? r : h,
                            this.maxY = s > u ? s : u
                        }
                    }
                }, {
                    key: "addBoundsArea",
                    value: function (t, e) {
                        var i = t.minX > e.x ? t.minX : e.x,
                        n = t.minY > e.y ? t.minY : e.y,
                        r = t.maxX < e.x + e.width ? t.maxX : e.x + e.width,
                        s = t.maxY < e.y + e.height ? t.maxY : e.y + e.height;
                        if (i <= r && n <= s) {
                            var a = this.minX,
                            o = this.minY,
                            h = this.maxX,
                            u = this.maxY;
                            this.minX = i < a ? i : a,
                            this.minY = n < o ? n : o,
                            this.maxX = r > h ? r : h,
                            this.maxY = s > u ? s : u
                        }
                    }
                }
            ]),
        t
    }
    (),
    hi = function (t) {
        function e() {
            p(this, e);
            var t = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this)),
            i = Ze.TRANSFORM_MODE === Xt.STATIC ? si : ai;
            return t.tempDisplayObjectParent = null,
            t.transform = new i,
            t.alpha = 1,
            t.visible = !0,
            t.renderable = !0,
            t.parent = null,
            t.worldAlpha = 1,
            t.filterArea = null,
            t._filters = null,
            t._enabledFilters = null,
            t._bounds = new oi,
            t._boundsID = 0,
            t._lastBoundsID = -1,
            t._boundsRect = null,
            t._localBoundsRect = null,
            t._mask = null,
            t._destroyed = !1,
            t.name = null,
            t
        }
        return m(e, f),
        g(e, [{
                    key: "updateTransform",
                    value: function () {
                        this.transform.updateTransform(this.parent.transform),
                        this.worldAlpha = this.alpha * this.parent.worldAlpha,
                        this._bounds.updateID++
                    }
                }, {
                    key: "_recursivePostUpdateTransform",
                    value: function () {
                        this.parent ? (this.parent._recursivePostUpdateTransform(), this.transform.updateTransform(this.parent.transform)) : this.transform.updateTransform(this._tempDisplayObjectParent.transform)
                    }
                }, {
                    key: "getBounds",
                    value: function (t, e) {
                        return t || (this.parent ? (this._recursivePostUpdateTransform(), this.updateTransform()) : (this.parent = this._tempDisplayObjectParent, this.updateTransform(), this.parent = null)),
                        this._boundsID !== this._lastBoundsID && this.calculateBounds(),
                        e || (this._boundsRect || (this._boundsRect = new ee), e = this._boundsRect),
                        this._bounds.getRectangle(e)
                    }
                }, {
                    key: "getLocalBounds",
                    value: function (t) {
                        var e = this.transform,
                        i = this.parent;
                        this.parent = null,
                        this.transform = this._tempDisplayObjectParent.transform,
                        t || (this._localBoundsRect || (this._localBoundsRect = new ee), t = this._localBoundsRect);
                        var n = this.getBounds(!1, t);
                        return this.parent = i,
                        this.transform = e,
                        n
                    }
                }, {
                    key: "toGlobal",
                    value: function (t, e) {
                        return arguments.length > 2 && void 0 !== arguments[2] && arguments[2] || (this._recursivePostUpdateTransform(), this.parent ? this.displayObjectUpdateTransform() : (this.parent = this._tempDisplayObjectParent, this.displayObjectUpdateTransform(), this.parent = null)),
                        this.worldTransform.apply(t, e)
                    }
                }, {
                    key: "toLocal",
                    value: function (t, e, i, n) {
                        return e && (t = e.toGlobal(t, i, n)),
                        n || (this._recursivePostUpdateTransform(), this.parent ? this.displayObjectUpdateTransform() : (this.parent = this._tempDisplayObjectParent, this.displayObjectUpdateTransform(), this.parent = null)),
                        this.worldTransform.applyInverse(t, i)
                    }
                }, {
                    key: "getGlobalPosition",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : new Yt,
                        e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                        return this.parent ? this.parent.toGlobal(this.position, t, e) : (t.x = this.position.x, t.y = this.position.y),
                        t
                    }
                }, {
                    key: "getChildByName",
                    value: function (t) {
                        for (var e = 0; e < this.children.length; e++)
                            if (this.children[e].name === t)
                                return this.children[e];
                        return null
                    }
                }, {
                    key: "renderWebGL",
                    value: function (t) {}
                }, {
                    key: "renderCanvas",
                    value: function (t) {}
                }, {
                    key: "setParent",
                    value: function (t) {
                        if (!t || !t.addChild)
                            throw new Error("setParent: Argument must be a Container");
                        return t.addChild(this),
                        t
                    }
                }, {
                    key: "setTransform",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                        e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                        i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
                        n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1,
                        r = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0,
                        s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0,
                        a = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 0,
                        o = arguments.length > 7 && void 0 !== arguments[7] ? arguments[7] : 0,
                        h = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : 0;
                        return this.position.x = t,
                        this.position.y = e,
                        this.scale.x = i || 1,
                        this.scale.y = n || 1,
                        this.rotation = r,
                        this.skew.x = s,
                        this.skew.y = a,
                        this.pivot.x = o,
                        this.pivot.y = h,
                        this
                    }
                }, {
                    key: "setEventEnabled",
                    value: function (t) {
                        this.interactive = !!t
                    }
                }, {
                    key: "setPosition",
                    value: function (t, e) {
                        this.position.set(t, void 0 === e ? t : e)
                    }
                }, {
                    key: "getPosition",
                    value: function () {
                        return this.position
                    }
                }, {
                    key: "setPositionX",
                    value: function (t) {
                        this.x = t
                    }
                }, {
                    key: "getPositionX",
                    value: function () {
                        return this.x
                    }
                }, {
                    key: "setPositionY",
                    value: function (t) {
                        this.y = t
                    }
                }, {
                    key: "getPositionY",
                    value: function () {
                        return this.y
                    }
                }, {
                    key: "setPivot",
                    value: function (t, e) {
                        this.pivot.set(t, void 0 === e ? t : e)
                    }
                }, {
                    key: "getPivot",
                    value: function () {
                        return this.pivot
                    }
                }, {
                    key: "setRotation",
                    value: function (t) {
                        this.rotation = t
                    }
                }, {
                    key: "getRotation",
                    value: function () {
                        return this.rotation
                    }
                }, {
                    key: "setOpacity",
                    value: function (t) {
                        this.alpha = t
                    }
                }, {
                    key: "getOpacity",
                    value: function () {
                        return this.alpha
                    }
                }, {
                    key: "setVisible",
                    value: function (t) {
                        this.visible = t
                    }
                }, {
                    key: "getVisible",
                    value: function () {
                        return this.visible
                    }
                }, {
                    key: "setScale",
                    value: function (t, e) {
                        this.scale.set(t, void 0 === e ? t : e)
                    }
                }, {
                    key: "getScale",
                    value: function () {
                        return this.scale
                    }
                }, {
                    key: "setSkew",
                    value: function (t, e) {
                        this.skew.set(t, void 0 === e ? t : e)
                    }
                }, {
                    key: "getSkew",
                    value: function () {
                        return this.skew
                    }
                }, {
                    key: "getNature",
                    value: function () {
                        var t = pt(this.tint);
                        return {
                            x: this.x,
                            y: this.y,
                            angle: this.angle || 0,
                            rotation: this.rotation,
                            visible: this.visible,
                            alpha: this.alpha,
                            scaleX: this.scale.x,
                            scaleY: this.scale.y,
                            skewX: this.skew.x,
                            skewY: this.skew.y,
                            colorR: 255 * t[0],
                            colorG: 255 * t[1],
                            colorB: 255 * t[2]
                        }
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.parent && this.parent.removeChild(this),
                        this.removeAllListeners(),
                        this.transform = null,
                        this.parent = null,
                        this._bounds = null,
                        this._currentBounds = null,
                        this._mask = null,
                        this.filterArea = null,
                        this.interactive = !1,
                        this.interactiveChildren = !1,
                        this._destroyed = !0
                    }
                }, {
                    key: "_tempDisplayObjectParent",
                    get: function () {
                        return null === this.tempDisplayObjectParent && (this.tempDisplayObjectParent = new e),
                        this.tempDisplayObjectParent
                    }
                }, {
                    key: "x",
                    get: function () {
                        return this.position.x
                    },
                    set: function (t) {
                        this.transform.position.x = t
                    }
                }, {
                    key: "y",
                    get: function () {
                        return this.position.y
                    },
                    set: function (t) {
                        this.transform.position.y = t
                    }
                }, {
                    key: "worldTransform",
                    get: function () {
                        return this.transform.worldTransform
                    }
                }, {
                    key: "localTransform",
                    get: function () {
                        return this.transform.localTransform
                    }
                }, {
                    key: "position",
                    get: function () {
                        return this.transform.position
                    },
                    set: function (t) {
                        this.transform.position.copy(t)
                    }
                }, {
                    key: "scale",
                    get: function () {
                        return this.transform.scale
                    },
                    set: function (t) {
                        this.transform.scale.copy(t)
                    }
                }, {
                    key: "pivot",
                    get: function () {
                        return this.transform.pivot
                    },
                    set: function (t) {
                        this.transform.pivot.copy(t)
                    }
                }, {
                    key: "skew",
                    get: function () {
                        return this.transform.skew
                    },
                    set: function (t) {
                        this.transform.skew.copy(t)
                    }
                }, {
                    key: "rotation",
                    get: function () {
                        return this.transform.rotation
                    },
                    set: function (t) {
                        this.transform.rotation = t
                    }
                }, {
                    key: "worldVisible",
                    get: function () {
                        var t = this;
                        do {
                            if (!t.visible)
                                return !1;
                            t = t.parent
                        } while (t);
                        return !0
                    }
                }, {
                    key: "mask",
                    get: function () {
                        return this._mask
                    },
                    set: function (t) {
                        this._mask && (this._mask.renderable = !0, this._mask.isMask = !1),
                        this._mask = t,
                        this._mask && (this._mask.renderable = !1, this._mask.isMask = !0)
                    }
                }, {
                    key: "filters",
                    get: function () {
                        return this._filters && this._filters.slice()
                    },
                    set: function (t) {
                        this._filters = t && t.slice()
                    }
                }
            ]),
        e
    }
    ();
    hi.prototype.displayObjectUpdateTransform = hi.prototype.updateTransform;
    var ui = function (t) {
        function e() {
            p(this, e);
            var t = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return t.children = [],
            t.actions = [],
            t.on("removed", function () {
                t.removeActionsTrace()
            }),
            t
        }
        return m(e, hi),
        g(e, [{
                    key: "removeActions",
                    value: function () {
                        0 !== this.actions.length && (this.actions.forEach(function (t) {
                                w.remove(t)
                            }), this.actions = [])
                    }
                }, {
                    key: "removeActionsTrace",
                    value: function () {
                        0 !== this.children.length && this.children.forEach(function (t) {
                            t.removeActionsTrace()
                        }),
                        this.removeActions()
                    }
                }, {
                    key: "onChildrenChange",
                    value: function () {}
                }, {
                    key: "addChild",
                    value: function (t) {
                        var e = arguments.length;
                        if (e > 1)
                            for (var i = 0; i < e; i++)
                                this.addChild(arguments[i]);
                        else
                            t.parent && t.parent.removeChild(t), t.parent = this, t.transform._parentID = -1, this.children.push(t), this._boundsID++, this.onChildrenChange(this.children.length - 1), t.emit("added", this);
                        return t
                    }
                }, {
                    key: "addChildAt",
                    value: function (t, e) {
                        if (e < 0 || e > this.children.length)
                            throw new Error(t + "addChildAt: The index " + e + " supplied is out of bounds " + this.children.length);
                        return t.parent && t.parent.removeChild(t),
                        t.parent = this,
                        t.transform._parentID = -1,
                        this.children.splice(e, 0, t),
                        this._boundsID++,
                        this.onChildrenChange(e),
                        t.emit("added", this),
                        t
                    }
                }, {
                    key: "swapChildren",
                    value: function (t, e) {
                        if (t !== e) {
                            var i = this.getChildIndex(t),
                            n = this.getChildIndex(e);
                            this.children[i] = e,
                            this.children[n] = t,
                            this.onChildrenChange(i < n ? i : n)
                        }
                    }
                }, {
                    key: "getChildIndex",
                    value: function (t) {
                        var e = this.children.indexOf(t);
                        if (-1 === e)
                            throw new Error("The supplied DisplayObject must be a child of the caller");
                        return e
                    }
                }, {
                    key: "setChildIndex",
                    value: function (t, e) {
                        if (e < 0 || e >= this.children.length)
                            throw new Error("The index " + e + " supplied is out of bounds " + this.children.length);
                        var i = this.getChildIndex(t);
                        kt(this.children, i, 1),
                        this.children.splice(e, 0, t),
                        this.onChildrenChange(e)
                    }
                }, {
                    key: "getChildAt",
                    value: function (t) {
                        if (t < 0 || t >= this.children.length)
                            throw new Error("getChildAt: Index (" + t + ") does not exist.");
                        return this.children[t]
                    }
                }, {
                    key: "removeChild",
                    value: function (t) {
                        var e = arguments.length;
                        if (e > 1)
                            for (var i = 0; i < e; i++)
                                this.removeChild(arguments[i]);
                        else {
                            var n = this.children.indexOf(t);
                            if (-1 === n)
                                return null;
                            t.parent = null,
                            t.transform._parentID = -1,
                            kt(this.children, n, 1),
                            this._boundsID++,
                            this.onChildrenChange(n),
                            t.emit("removed", this)
                        }
                        return t
                    }
                }, {
                    key: "removeChildAt",
                    value: function (t) {
                        var e = this.getChildAt(t);
                        return e.parent = null,
                        e.transform._parentID = -1,
                        kt(this.children, t, 1),
                        this._boundsID++,
                        this.onChildrenChange(t),
                        e.emit("removed", this),
                        e
                    }
                }, {
                    key: "removeChildren",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                        e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null,
                        i = t,
                        n = "number" == typeof e ? e : this.children.length,
                        r = n - i,
                        s = void 0;
                        if (r > 0 && r <= n) {
                            s = this.children.splice(i, r);
                            for (var a = 0; a < s.length; ++a)
                                s[a].parent = null, s[a].transform && (s[a].transform._parentID = -1);
                            this._boundsID++,
                            this.onChildrenChange(t);
                            for (var o = 0; o < s.length; ++o)
                                s[o].emit("removed", this);
                            return s
                        }
                        if (0 === r && 0 === this.children.length)
                            return [];
                        throw new RangeError("removeChildren: numeric values are outside the acceptable range.")
                    }
                }, {
                    key: "updateTransform",
                    value: function () {
                        this._boundsID++,
                        this.transform.updateTransform(this.parent.transform),
                        this.worldAlpha = this.alpha * this.parent.worldAlpha;
                        for (var t = 0, e = this.children.length; t < e; ++t) {
                            var i = this.children[t];
                            i.visible && i.updateTransform()
                        }
                    }
                }, {
                    key: "calculateBounds",
                    value: function () {
                        this._bounds.clear(),
                        this._calculateBounds();
                        for (var t = 0; t < this.children.length; t++) {
                            var e = this.children[t];
                            e.visible && e.renderable && (e.calculateBounds(), e._mask ? (e._mask.calculateBounds(), this._bounds.addBoundsMask(e._bounds, e._mask._bounds)) : e.filterArea ? this._bounds.addBoundsArea(e._bounds, e.filterArea) : this._bounds.addBounds(e._bounds))
                        }
                        this._lastBoundsID = this._boundsID
                    }
                }, {
                    key: "_calculateBounds",
                    value: function () {}
                }, {
                    key: "renderWebGL",
                    value: function (t) {
                        if (this.visible && !(this.worldAlpha <= 0) && this.renderable)
                            if (this._mask || this._filters)
                                this.renderAdvancedWebGL(t);
                            else {
                                this._renderWebGL(t);
                                for (var e = 0, i = this.children.length; e < i; ++e)
                                    this.children[e].renderWebGL(t)
                            }
                    }
                }, {
                    key: "renderAdvancedWebGL",
                    value: function (t) {
                        t.flush();
                        var e = this._filters,
                        i = this._mask;
                        if (e) {
                            this._enabledFilters || (this._enabledFilters = []),
                            this._enabledFilters.length = 0;
                            for (var n = 0; n < e.length; n++)
                                e[n].enabled && this._enabledFilters.push(e[n]);
                            this._enabledFilters.length && t.filterManager.pushFilter(this, this._enabledFilters)
                        }
                        i && t.maskManager.pushMask(this, this._mask),
                        this._renderWebGL(t);
                        for (var r = 0, s = this.children.length; r < s; r++)
                            this.children[r].renderWebGL(t);
                        t.flush(),
                        i && t.maskManager.popMask(this, this._mask),
                        e && this._enabledFilters && this._enabledFilters.length && t.filterManager.popFilter()
                    }
                }, {
                    key: "_renderWebGL",
                    value: function (t) {}
                }, {
                    key: "_renderCanvas",
                    value: function (t) {}
                }, {
                    key: "renderCanvas",
                    value: function (t) {
                        if (this.visible && !(this.worldAlpha <= 0) && this.renderable) {
                            this._mask && t.maskManager.pushMask(this._mask),
                            this._renderCanvas(t);
                            for (var e = 0, i = this.children.length; e < i; ++e)
                                this.children[e].renderCanvas(t);
                            this._mask && t.maskManager.popMask(t)
                        }
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this);
                        var i = "boolean" == typeof t ? t : t && t.children,
                        n = this.removeChildren(0, this.children.length);
                        if (i)
                            for (var r = 0; r < n.length; ++r)
                                n[r].destroy(t)
                    }
                }, {
                    key: "width",
                    get: function () {
                        return this.scale.x * this.getLocalBounds().width
                    },
                    set: function (t) {
                        var e = this.getLocalBounds().width;
                        this.scale.x = 0 !== e ? t / e : 1,
                        this._width = t
                    }
                }, {
                    key: "height",
                    get: function () {
                        return this.scale.y * this.getLocalBounds().height
                    },
                    set: function (t) {
                        var e = this.getLocalBounds().height;
                        this.scale.y = 0 !== e ? t / e : 1,
                        this._height = t
                    }
                }
            ]),
        e
    }
    ();
    function li(t) {
        return !(t & t - 1 || !t)
    }
    function ci(t) {
        return t += 0 === t,
        --t,
        t |= t >>> 1,
        t |= t >>> 2,
        t |= t >>> 4,
        t |= t >>> 8,
        (t |= t >>> 16) + 1
    }
    ui.prototype.containerUpdateTransform = ui.prototype.updateTransform;
    var di = function (t) {
        function e(t, i, n) {
            p(this, e);
            var r = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return r.uid = Xe(),
            r.touched = 0,
            r.resolution = n || Ze.RESOLUTION,
            r.width = 100,
            r.height = 100,
            r.realWidth = 100,
            r.realHeight = 100,
            r.scaleMode = void 0 !== i ? i : Ze.SCALE_MODE,
            r.hasLoaded = !1,
            r.isLoading = !1,
            r.source = null,
            r.origSource = null,
            r.imageType = null,
            r.sourceScale = 1,
            r.premultipliedAlpha = !0,
            r.imageUrl = null,
            r.isPowerOfTwo = !1,
            r.mipmap = Ze.MIPMAP_TEXTURES,
            r.wrapMode = Ze.WRAP_MODE,
            r._glTextures = {},
            r._enabled = 0,
            r._virtalBoundId = -1,
            r._destroyed = !1,
            r.textureCacheIds = [],
            t && r.loadSource(t),
            r
        }
        return m(e, f),
        g(e, [{
                    key: "update",
                    value: function () {
                        "svg" !== this.imageType && (this.realWidth = this.source.naturalWidth || this.source.videoWidth || this.source.width, this.realHeight = this.source.naturalHeight || this.source.videoHeight || this.source.height, this._updateDimensions()),
                        this.emit("update", this)
                    }
                }, {
                    key: "_updateDimensions",
                    value: function () {
                        this.width = this.realWidth / this.resolution,
                        this.height = this.realHeight / this.resolution,
                        this.isPowerOfTwo = li(this.realWidth) && li(this.realHeight)
                    }
                }, {
                    key: "loadSource",
                    value: function (t) {
                        var e = this.isLoading;
                        this.hasLoaded = !1,
                        this.isLoading = !1,
                        e && this.source && (this.source.onload = null, this.source.onerror = null);
                        var i = !this.source;
                        if (this.source = t, (t.src && t.complete || t.getContext) && t.width && t.height)
                            this._updateImageType(), "svg" === this.imageType ? this._loadSvgSource() : this._sourceLoaded(), i && this.emit("loaded", this);
                        else if (!t.getContext) {
                            this.isLoading = !0;
                            var n = this;
                            if (t.onload = function () {
                                n._updateImageType(),
                                t.onload = null,
                                t.onerror = null,
                                n.isLoading && (n.isLoading = !1, n._sourceLoaded(), "svg" !== n.imageType ? n.emit("loaded", n) : n._loadSvgSource())
                            }, t.onerror = function () {
                                t.onload = null,
                                t.onerror = null,
                                n.isLoading && (n.isLoading = !1, n.emit("error", n))
                            }, t.complete && t.src) {
                                if (t.onload = null, t.onerror = null, "svg" === n.imageType)
                                    return void n._loadSvgSource();
                                this.isLoading = !1,
                                t.width && t.height ? (this._sourceLoaded(), e && this.emit("loaded", this)) : e && this.emit("error", this)
                            }
                        }
                    }
                }, {
                    key: "_updateImageType",
                    value: function () {
                        if (this.imageUrl) {
                            var t = Ot(this.imageUrl),
                            e = void 0;
                            if (t && "image" === t.mediaType) {
                                if (!(e = Ct("." + t.subType.split("+")[0])))
                                    throw new Error("Invalid image type in data URI.")
                            } else (e = Ct(this.imageUrl)) || (e = "png");
                            this.imageType = e
                        }
                    }
                }, {
                    key: "_loadSvgSource",
                    value: function () {
                        if ("svg" === this.imageType) {
                            var t = Ot(this.imageUrl);
                            t ? this._loadSvgSourceUsingDataUri(t) : this._loadSvgSourceUsingXhr()
                        }
                    }
                }, {
                    key: "_loadSvgSourceUsingDataUri",
                    value: function (t) {
                        var e = void 0;
                        if ("base64" === t.encoding) {
                            if (!atob)
                                throw new Error("Your browser doesn't support base64 conversions.");
                            e = atob(t.data)
                        } else
                            e = t.data;
                        this._loadSvgSourceUsingString(e)
                    }
                }, {
                    key: "_loadSvgSourceUsingXhr",
                    value: function () {
                        var t = this,
                        e = new XMLHttpRequest;
                        e.onload = function () {
                            if (e.readyState !== e.DONE || 200 !== e.status)
                                throw new Error("Failed to load SVG using XHR.");
                            t._loadSvgSourceUsingString(e.response)
                        },
                        e.onerror = function () {
                            return t.emit("error", t)
                        },
                        e.open("GET", this.imageUrl, !0),
                        e.send()
                    }
                }, {
                    key: "_loadSvgSourceUsingString",
                    value: function (t) {
                        var i = St(t),
                        n = i.width,
                        r = i.height;
                        if (!n || !r)
                            throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");
                        this.realWidth = Math.round(n * this.sourceScale),
                        this.realHeight = Math.round(r * this.sourceScale),
                        this._updateDimensions();
                        var s = document.createElement("canvas");
                        s.width = this.realWidth,
                        s.height = this.realHeight,
                        s._tinyId = "canvas_" + Xe(),
                        s.getContext("2d").drawImage(this.source, 0, 0, n, r, 0, 0, this.realWidth, this.realHeight),
                        this.origSource = this.source,
                        this.source = s,
                        e.addToCache(this, s._tinyId),
                        this.isLoading = !1,
                        this._sourceLoaded(),
                        this.emit("loaded", this)
                    }
                }, {
                    key: "_sourceLoaded",
                    value: function () {
                        this.hasLoaded = !0,
                        this.update()
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.imageUrl && (delete Ge[this.imageUrl], this.imageUrl = null, navigator.isCanvasPlus || (this.source.src = "")),
                        this.source = null,
                        this.dispose(),
                        e.removeFromCache(this),
                        this.textureCacheIds = null,
                        this._destroyed = !0
                    }
                }, {
                    key: "dispose",
                    value: function () {
                        this.emit("dispose", this)
                    }
                }, {
                    key: "updateSourceImage",
                    value: function (t) {
                        this.source.src = t,
                        this.loadSource(this.source)
                    }
                }
            ], [{
                    key: "fromImage",
                    value: function (t, i, n, r) {
                        var s = We[t];
                        if (!s) {
                            var a = new Image;
                            void 0 === i && 0 !== t.indexOf("data:") ? a.crossOrigin = D(t) : i && (a.crossOrigin = "string" == typeof i ? i : "anonymous"),
                            (s = new e(a, n)).imageUrl = t,
                            r && (s.sourceScale = r),
                            s.resolution = Pt(t),
                            a.src = t,
                            e.addToCache(s, t)
                        }
                        return s
                    }
                }, {
                    key: "fromCanvas",
                    value: function (t, i) {
                        var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "canvas";
                        t._tinyId || (t._tinyId = n + "_" + Xe());
                        var r = We[t._tinyId];
                        return r || (r = new e(t, i), e.addToCache(r, t._tinyId)),
                        r
                    }
                }, {
                    key: "from",
                    value: function (t, i, n) {
                        if ("string" == typeof t)
                            return e.fromImage(t, void 0, i, n);
                        if (t instanceof HTMLImageElement) {
                            var r = t.src,
                            s = We[r];
                            return s || ((s = new e(t, i)).imageUrl = r, n && (s.sourceScale = n), s.resolution = Pt(r), e.addToCache(s, r)),
                            s
                        }
                        return t instanceof HTMLCanvasElement ? e.fromCanvas(t, i) : t
                    }
                }, {
                    key: "addToCache",
                    value: function (t, e) {
                        e && (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e), We[e] = t)
                    }
                }, {
                    key: "removeFromCache",
                    value: function (t) {
                        if ("string" == typeof t) {
                            var e = We[t];
                            if (e) {
                                var i = e.textureCacheIds.indexOf(t);
                                return i > -1 && e.textureCacheIds.splice(i, 1),
                                delete We[t],
                                e
                            }
                        } else if (t && t.textureCacheIds) {
                            for (var n = 0; n < t.textureCacheIds.length; ++n)
                                delete We[t.textureCacheIds[n]];
                            return t.textureCacheIds.length = 0,
                            t
                        }
                        return null
                    }
                }
            ]),
        e
    }
    (),
    fi = function (t) {
        function e() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 100,
            i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 100,
            n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0,
            r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1;
            p(this, e);
            var s = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, null, n));
            return s.resolution = r || Ze.RESOLUTION,
            s.width = Math.ceil(t),
            s.height = Math.ceil(i),
            s.realWidth = s.width * s.resolution,
            s.realHeight = s.height * s.resolution,
            s.scaleMode = void 0 !== n ? n : Ze.SCALE_MODE,
            s.hasLoaded = !0,
            s._glRenderTargets = {},
            s._canvasRenderTarget = null,
            s.valid = !1,
            s
        }
        return m(e, di),
        g(e, [{
                    key: "resize",
                    value: function (t, e) {
                        t = Math.ceil(t),
                        e = Math.ceil(e),
                        t === this.width && e === this.height || (this.valid = t > 0 && e > 0, this.width = t, this.height = e, this.realWidth = this.width * this.resolution, this.realHeight = this.height * this.resolution, this.valid && this.emit("update", this))
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, !0),
                        this.renderer = null
                    }
                }
            ]),
        e
    }
    (),
    vi = function (t) {
        function e(t, i) {
            if (p(this, e), !t)
                throw new Error("No video source element specified.");
            (t.readyState === t.HAVE_ENOUGH_DATA || t.readyState === t.HAVE_FUTURE_DATA) && t.width && t.height && (t.complete = !0);
            var n = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, i));
            return n.width = t.videoWidth,
            n.height = t.videoHeight,
            n._autoUpdate = !0,
            n._isAutoUpdating = !1,
            n.autoPlay = !0,
            n.update = n.update.bind(n),
            n._onCanPlay = n._onCanPlay.bind(n),
            t.addEventListener("play", n._onPlayStart.bind(n)),
            t.addEventListener("pause", n._onPlayStop.bind(n)),
            n.hasLoaded = !1,
            n.__loaded = !1,
            n._isSourceReady() ? n._onCanPlay() : (t.addEventListener("canplay", n._onCanPlay), t.addEventListener("canplaythrough", n._onCanPlay)),
            n
        }
        return m(e, di),
        g(e, [{
                    key: "_isSourcePlaying",
                    value: function () {
                        var t = this.source;
                        return t.currentTime > 0 && !1 === t.paused && !1 === t.ended && t.readyState > 2
                    }
                }, {
                    key: "_isSourceReady",
                    value: function () {
                        return 3 === this.source.readyState || 4 === this.source.readyState
                    }
                }, {
                    key: "_onPlayStart",
                    value: function () {
                        this.hasLoaded || this._onCanPlay(),
                        !this._isAutoUpdating && this.autoUpdate && (ii.add(this.update, this, Gt.HIGH), this._isAutoUpdating = !0)
                    }
                }, {
                    key: "_onPlayStop",
                    value: function () {
                        this._isAutoUpdating && (ii.remove(this.update, this), this._isAutoUpdating = !1)
                    }
                }, {
                    key: "_onCanPlay",
                    value: function () {
                        this.hasLoaded = !0,
                        this.source && (this.source.removeEventListener("canplay", this._onCanPlay), this.source.removeEventListener("canplaythrough", this._onCanPlay), this.width = this.source.videoWidth, this.height = this.source.videoHeight, this.__loaded || (this.__loaded = !0, this.emit("loaded", this)), this._isSourcePlaying() ? this._onPlayStart() : this.autoPlay && this.source.play())
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this._isAutoUpdating && ii.remove(this.update, this),
                        this.source && this.source._tinyId && (di.removeFromCache(this.source._tinyId), delete this.source._tinyId, this.source.pause(), this.source.src = "", this.source.load()),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this)
                    }
                }, {
                    key: "autoUpdate",
                    get: function () {
                        return this._autoUpdate
                    },
                    set: function (t) {
                        t !== this._autoUpdate && (this._autoUpdate = t, !this._autoUpdate && this._isAutoUpdating ? (ii.remove(this.update, this), this._isAutoUpdating = !1) : this._autoUpdate && !this._isAutoUpdating && (ii.add(this.update, this, Gt.HIGH), this._isAutoUpdating = !0))
                    }
                }
            ], [{
                    key: "fromVideo",
                    value: function (t, i) {
                        t._tinyId || (t._tinyId = "video_" + Xe());
                        var n = We[t._tinyId];
                        return n || (n = new e(t, i), di.addToCache(n, t._tinyId)),
                        n
                    }
                }, {
                    key: "fromUrl",
                    value: function (t, i, n) {
                        var r = document.createElement("video");
                        r.setAttribute("webkit-playsinline", ""),
                        r.setAttribute("playsinline", "");
                        var s = Array.isArray(t) ? t[0].src || t[0] : t.src || t;
                        if (void 0 === n && 0 !== s.indexOf("data:") ? r.crossOrigin = D(s) : n && (r.crossOrigin = "string" == typeof n ? n : "anonymous"), Array.isArray(t))
                            for (var a = 0; a < t.length; ++a)
                                r.appendChild(pi(t[a].src || t[a], t[a].mime));
                        else
                            r.appendChild(pi(s, t.mime));
                        return r.load(),
                        e.fromVideo(r, i)
                    }
                }
            ]),
        e
    }
    ();
    function pi(t, e) {
        e || (e = "video/" + (t = t.split("?").shift()).substr(t.lastIndexOf(".") + 1));
        var i = document.createElement("source");
        return i.src = t,
        i.type = e,
        i
    }
    vi.fromUrls = vi.fromUrl;
    var gi = function () {
        function t() {
            p(this, t),
            this.x0 = 0,
            this.y0 = 0,
            this.x1 = 1,
            this.y1 = 0,
            this.x2 = 1,
            this.y2 = 1,
            this.x3 = 0,
            this.y3 = 1,
            this.uvsUint32 = new Uint32Array(4)
        }
        return g(t, [{
                    key: "set",
                    value: function (t, e, i) {
                        var n = e.width,
                        r = e.height;
                        if (i) {
                            var s = t.width / 2 / n,
                            a = t.height / 2 / r,
                            o = t.x / n + s,
                            h = t.y / r + a;
                            i = te.add(i, te.NW),
                            this.x0 = o + s * te.uX(i),
                            this.y0 = h + a * te.uY(i),
                            i = te.add(i, 2),
                            this.x1 = o + s * te.uX(i),
                            this.y1 = h + a * te.uY(i),
                            i = te.add(i, 2),
                            this.x2 = o + s * te.uX(i),
                            this.y2 = h + a * te.uY(i),
                            i = te.add(i, 2),
                            this.x3 = o + s * te.uX(i),
                            this.y3 = h + a * te.uY(i)
                        } else
                            this.x0 = t.x / n, this.y0 = t.y / r, this.x1 = (t.x + t.width) / n, this.y1 = t.y / r, this.x2 = (t.x + t.width) / n, this.y2 = (t.y + t.height) / r, this.x3 = t.x / n, this.y3 = (t.y + t.height) / r;
                        this.uvsUint32[0] = (65535 * this.y0 & 65535) << 16 | 65535 * this.x0 & 65535,
                        this.uvsUint32[1] = (65535 * this.y1 & 65535) << 16 | 65535 * this.x1 & 65535,
                        this.uvsUint32[2] = (65535 * this.y2 & 65535) << 16 | 65535 * this.x2 & 65535,
                        this.uvsUint32[3] = (65535 * this.y3 & 65535) << 16 | 65535 * this.x3 & 65535
                    }
                }
            ]),
        t
    }
    (),
    yi = function (t) {
        function e(t, i, n, r, s, a) {
            p(this, e);
            var o = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            if (o.noFrame = !1, i || (o.noFrame = !0, i = new ee(0, 0, 1, 1)), t instanceof e && (t = t.baseTexture), o.baseTexture = t, o._frame = i, o.trim = r, o.valid = !1, o.requiresUpdate = !1, o._uvs = null, o.orig = n || i, o._rotate = Number(s || 0), !0 === s)
                o._rotate = 2;
            else if (o._rotate % 2 != 0)
                throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");
            return t.hasLoaded ? (o.noFrame && (i = new ee(0, 0, t.width, t.height), t.on("update", o.onBaseTextureUpdated, o)), o.frame = i) : t.once("loaded", o.onBaseTextureLoaded, o),
            o.defaultAnchor = a ? new Yt(a.x, a.y) : new Yt(0, 0),
            o._updateID = 0,
            o.transform = null,
            o.textureCacheIds = [],
            o
        }
        return m(e, f),
        g(e, [{
                    key: "update",
                    value: function () {
                        this.baseTexture.update()
                    }
                }, {
                    key: "onBaseTextureLoaded",
                    value: function (t) {
                        this._updateID++,
                        this.noFrame ? this.frame = new ee(0, 0, t.width, t.height) : this.frame = this._frame,
                        this.baseTexture.on("update", this.onBaseTextureUpdated, this),
                        this.emit("update", this)
                    }
                }, {
                    key: "onBaseTextureUpdated",
                    value: function (t) {
                        this._updateID++,
                        this._frame.width = t.width,
                        this._frame.height = t.height,
                        this.emit("update", this)
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        this.baseTexture && (t && (Ge[this.baseTexture.imageUrl] && e.removeFromCache(this.baseTexture.imageUrl), this.baseTexture.destroy()), this.baseTexture.off("update", this.onBaseTextureUpdated, this), this.baseTexture.off("loaded", this.onBaseTextureLoaded, this), this.baseTexture = null),
                        this._frame = null,
                        this._uvs = null,
                        this.trim = null,
                        this.orig = null,
                        this.valid = !1,
                        e.removeFromCache(this),
                        this.textureCacheIds = null
                    }
                }, {
                    key: "clone",
                    value: function () {
                        return new e(this.baseTexture, this.frame, this.orig, this.trim, this.rotate)
                    }
                }, {
                    key: "_updateUvs",
                    value: function () {
                        this._uvs || (this._uvs = new gi),
                        this._uvs.set(this._frame, this.baseTexture, this.rotate),
                        this._updateID++
                    }
                }, {
                    key: "frame",
                    get: function () {
                        return this._frame
                    },
                    set: function (t) {
                        this._frame = t,
                        this.noFrame = !1;
                        var e = t.x,
                        i = t.y,
                        n = t.width,
                        r = t.height,
                        s = e + n > this.baseTexture.width,
                        a = i + r > this.baseTexture.height;
                        if (s || a) {
                            var o = s && a ? "and" : "or",
                            h = "X: " + e + " + " + n + " = " + (e + n) + " > " + this.baseTexture.width,
                            u = "Y: " + i + " + " + r + " = " + (i + r) + " > " + this.baseTexture.height;
                            throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: " + h + " " + o + " " + u)
                        }
                        this.valid = n && r && this.baseTexture.hasLoaded,
                        this.trim || this.rotate || (this.orig = t),
                        this.valid && this._updateUvs()
                    }
                }, {
                    key: "rotate",
                    get: function () {
                        return this._rotate
                    },
                    set: function (t) {
                        this._rotate = t,
                        this.valid && this._updateUvs()
                    }
                }, {
                    key: "width",
                    get: function () {
                        return this.orig.width
                    }
                }, {
                    key: "height",
                    get: function () {
                        return this.orig.height
                    }
                }
            ], [{
                    key: "fromImage",
                    value: function (t, i, n, r) {
                        var s = Ge[t];
                        return s || (s = new e(di.fromImage(t, i, n, r)), e.addToCache(s, t)),
                        s
                    }
                }, {
                    key: "fromFrame",
                    value: function (t) {
                        var e = Ge[t];
                        if (!e)
                            throw new Error('The frameId "' + t + '" does not exist in the texture cache');
                        return e
                    }
                }, {
                    key: "fromCanvas",
                    value: function (t, i) {
                        var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "canvas";
                        return new e(di.fromCanvas(t, i, n))
                    }
                }, {
                    key: "fromVideo",
                    value: function (t, i) {
                        return "string" == typeof t ? e.fromVideoUrl(t, i) : new e(vi.fromVideo(t, i))
                    }
                }, {
                    key: "fromVideoUrl",
                    value: function (t, i) {
                        return new e(vi.fromUrl(t, i))
                    }
                }, {
                    key: "from",
                    value: function (t) {
                        if ("string" == typeof t) {
                            var i = Ge[t];
                            return i || (null !== t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/) ? e.fromVideoUrl(t) : e.fromImage(t))
                        }
                        return t instanceof HTMLImageElement ? new e(di.from(t)) : t instanceof HTMLCanvasElement ? e.fromCanvas(t, Ze.SCALE_MODE, "HTMLCanvasElement") : t instanceof HTMLVideoElement ? e.fromVideo(t) : t instanceof di ? new e(t) : t
                    }
                }, {
                    key: "fromLoader",
                    value: function (t, i, n) {
                        var r = new di(t, void 0, Pt(i)),
                        s = new e(r);
                        return r.imageUrl = i,
                        n || (n = i),
                        di.addToCache(s.baseTexture, n),
                        e.addToCache(s, n),
                        n !== i && (di.addToCache(s.baseTexture, i), e.addToCache(s, i)),
                        s
                    }
                }, {
                    key: "addToCache",
                    value: function (t, e) {
                        e && (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e), Ge[e] = t)
                    }
                }, {
                    key: "removeFromCache",
                    value: function (t) {
                        if ("string" == typeof t) {
                            var e = Ge[t];
                            if (e) {
                                var i = e.textureCacheIds.indexOf(t);
                                return i > -1 && e.textureCacheIds.splice(i, 1),
                                delete Ge[t],
                                e
                            }
                        } else if (t && t.textureCacheIds) {
                            for (var n = 0; n < t.textureCacheIds.length; ++n)
                                Ge[t.textureCacheIds[n]] === t && delete Ge[t.textureCacheIds[n]];
                            return t.textureCacheIds.length = 0,
                            t
                        }
                        return null
                    }
                }
            ]),
        e
    }
    ();
    function _i(t) {
        t.destroy = function () {},
        t.on = function () {},
        t.once = function () {},
        t.emit = function () {}
    }
    yi.EMPTY = new yi(new di),
    _i(yi.EMPTY),
    _i(yi.EMPTY.baseTexture),
    yi.WHITE = function () {
        var t = document.createElement("canvas");
        t.width = 10,
        t.height = 10;
        var e = t.getContext("2d");
        return e.fillStyle = "white",
        e.fillRect(0, 0, 10, 10),
        new yi(new di(t))
    }
    (),
    _i(yi.WHITE),
    _i(yi.WHITE.baseTexture);
    var mi = function (t) {
        function e(t, i) {
            p(this, e);
            var n = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, i));
            return n.valid = !0,
            n._updateUvs(),
            n
        }
        return m(e, yi),
        g(e, [{
                    key: "resize",
                    value: function (t, e, i) {
                        t = Math.ceil(t),
                        e = Math.ceil(e),
                        this.valid = t > 0 && e > 0,
                        this._frame.width = this.orig.width = t,
                        this._frame.height = this.orig.height = e,
                        i || this.baseTexture.resize(t, e),
                        this._updateUvs()
                    }
                }
            ], [{
                    key: "create",
                    value: function (t, i, n, r) {
                        return new e(new fi(t, i, n, r))
                    }
                }
            ]),
        e
    }
    (),
    xi = new Vt,
    Ti = function (t) {
        function e(t, i, n, r) {
            p(this, e);
            var s = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return r = Object.assign({
                width: i,
                height: n
            }, r),
            r = Object.assign({}, Ze.RENDER_OPTIONS, r),
            s.options = r,
            s.type = Rt.UNKNOWN,
            s.screen = new ee(0, 0, r.width, r.height),
            s.view = r.view || document.createElement("canvas"),
            s.resolution = r.resolution || Ze.RESOLUTION,
            s.transparent = r.transparent,
            s.autoResize = r.autoResize || !1,
            s.blendModes = null,
            s.preserveDrawingBuffer = r.preserveDrawingBuffer,
            s.clearBeforeRender = r.clearBeforeRender,
            s.roundPixels = r.roundPixels,
            s._backgroundColor = 0,
            s._backgroundColorRgba = [0, 0, 0, 0],
            s._backgroundColorString = "#000000",
            s.backgroundColor = r.backgroundColor || s._backgroundColor,
            s._tempDisplayObjectParent = new ui,
            s._lastObjectRendered = s._tempDisplayObjectParent,
            s
        }
        return m(e, f),
        g(e, [{
                    key: "resize",
                    value: function (t, e) {
                        this.screen.width = t,
                        this.screen.height = e,
                        this.view.width = t * this.resolution,
                        this.view.height = e * this.resolution,
                        this.autoResize && (this.view.style.width = t + "px", this.view.style.height = e + "px", Wt.width = Math.round(this.width), Wt.height = Math.round(this.height))
                    }
                }, {
                    key: "generateTexture",
                    value: function (t, e, i, n) {
                        n = n || t.getLocalBounds();
                        var r = mi.create(0 | n.width, 0 | n.height, e, i);
                        return xi.tx = -n.x,
                        xi.ty = -n.y,
                        this.render(t, r, !1, xi, !!t.parent),
                        r
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        t && this.view.parentNode && this.view.parentNode.removeChild(this.view),
                        this.type = Rt.UNKNOWN,
                        this.view = null,
                        this.screen = null,
                        this.resolution = 0,
                        this.transparent = !1,
                        this.autoResize = !1,
                        this.blendModes = null,
                        this.options = null,
                        this.preserveDrawingBuffer = !1,
                        this.clearBeforeRender = !1,
                        this.roundPixels = !1,
                        this.backgroundColor = 0,
                        this._backgroundColorRgba = null,
                        this._backgroundColorString = null,
                        this._tempDisplayObjectParent = null,
                        this._lastObjectRendered = null
                    }
                }, {
                    key: "width",
                    get: function () {
                        return this.view.width
                    }
                }, {
                    key: "height",
                    get: function () {
                        return this.view.height
                    }
                }, {
                    key: "backgroundColor",
                    get: function () {
                        return this._backgroundColor
                    },
                    set: function (t) {
                        this._backgroundColor = t,
                        this._backgroundColorString = gt(t),
                        pt(t, this._backgroundColorRgba)
                    }
                }
            ]),
        e
    }
    (),
    wi = function () {
        function t(e) {
            p(this, t),
            this.renderer = e
        }
        return g(t, [{
                    key: "pushMask",
                    value: function (t) {
                        var e = this.renderer;
                        e.context.save();
                        var i = t.alpha,
                        n = t.transform.worldTransform,
                        r = e.resolution;
                        e.context.setTransform(n.a * r, n.b * r, n.c * r, n.d * r, n.tx * r, n.ty * r),
                        t._texture || (this.renderGraphicsShape(t), e.context.clip()),
                        t.worldAlpha = i
                    }
                }, {
                    key: "renderGraphicsShape",
                    value: function (t) {
                        var e = this.renderer.context,
                        i = t.graphicsData.length;
                        if (0 !== i) {
                            e.beginPath();
                            for (var n = 0; n < i; n++) {
                                var r = t.graphicsData[n],
                                s = r.shape;
                                if (r.type === Bt.POLY) {
                                    var a = s.points;
                                    e.moveTo(a[0], a[1]);
                                    for (var o = 1; o < a.length / 2; o++)
                                        e.lineTo(a[2 * o], a[2 * o + 1]);
                                    a[0] === a[a.length - 2] && a[1] === a[a.length - 1] && e.closePath()
                                } else if (r.type === Bt.RECT)
                                    e.rect(s.x, s.y, s.width, s.height), e.closePath();
                                else if (r.type === Bt.CIRC)
                                    e.arc(s.x, s.y, s.radius, 0, 2 * Math.PI), e.closePath();
                                else if (r.type === Bt.ELIP) {
                                    var h = 2 * s.width,
                                    u = 2 * s.height,
                                    l = s.x - h / 2,
                                    c = s.y - u / 2,
                                    d = h / 2 * .5522848,
                                    f = u / 2 * .5522848,
                                    v = l + h,
                                    p = c + u,
                                    g = l + h / 2,
                                    y = c + u / 2;
                                    e.moveTo(l, y),
                                    e.bezierCurveTo(l, y - f, g - d, c, g, c),
                                    e.bezierCurveTo(g + d, c, v, y - f, v, y),
                                    e.bezierCurveTo(v, y + f, g + d, p, g, p),
                                    e.bezierCurveTo(g - d, p, l, y + f, l, y),
                                    e.closePath()
                                } else if (r.type === Bt.RREC) {
                                    var _ = s.x,
                                    m = s.y,
                                    x = s.width,
                                    T = s.height,
                                    w = s.radius,
                                    b = Math.min(x, T) / 2 | 0;
                                    w = w > b ? b : w,
                                    e.moveTo(_, m + w),
                                    e.lineTo(_, m + T - w),
                                    e.quadraticCurveTo(_, m + T, _ + w, m + T),
                                    e.lineTo(_ + x - w, m + T),
                                    e.quadraticCurveTo(_ + x, m + T, _ + x, m + T - w),
                                    e.lineTo(_ + x, m + w),
                                    e.quadraticCurveTo(_ + x, m, _ + x - w, m),
                                    e.lineTo(_ + w, m),
                                    e.quadraticCurveTo(_, m, _, m + w),
                                    e.closePath()
                                }
                            }
                        }
                    }
                }, {
                    key: "popMask",
                    value: function (t) {
                        t.context.restore(),
                        t.invalidateBlendMode()
                    }
                }, {
                    key: "destroy",
                    value: function () {}
                }
            ]),
        t
    }
    (),
    bi = function () {
        function t(e, i, n) {
            p(this, t),
            this.canvas = document.createElement("canvas"),
            this.context = this.canvas.getContext("2d"),
            this.resolution = n || Ze.RESOLUTION,
            this.resize(e, i)
        }
        return g(t, [{
                    key: "clear",
                    value: function () {
                        this.context.setTransform(1, 0, 0, 1, 0, 0),
                        this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)
                    }
                }, {
                    key: "resize",
                    value: function (t, e) {
                        this.canvas.width = t * this.resolution,
                        this.canvas.height = e * this.resolution
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.context = null,
                        this.canvas = null
                    }
                }, {
                    key: "width",
                    get: function () {
                        return this.canvas.width
                    },
                    set: function (t) {
                        this.canvas.width = t
                    }
                }, {
                    key: "height",
                    get: function () {
                        return this.canvas.height
                    },
                    set: function (t) {
                        this.canvas.height = t
                    }
                }
            ]),
        t
    }
    ();
    function Ei(t) {
        var e = document.createElement("canvas");
        e.width = 6,
        e.height = 1;
        var i = e.getContext("2d");
        return i.fillStyle = t,
        i.fillRect(0, 0, 6, 1),
        e
    }
    function ki() {
        if ("undefined" == typeof document)
            return !1;
        var t = Ei("#ff00ff"),
        e = Ei("#ffff00"),
        i = document.createElement("canvas");
        i.width = 6,
        i.height = 1;
        var n = i.getContext("2d");
        n.globalCompositeOperation = "multiply",
        n.drawImage(t, 0, 0),
        n.drawImage(e, 2, 0);
        var r = n.getImageData(2, 0, 1, 1);
        if (!r)
            return !1;
        var s = r.data;
        return 255 === s[0] && 0 === s[1] && 0 === s[2]
    }
    var Si = function (t) {
        function e(t, i, n) {
            p(this, e);
            var r = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, "Canvas", t, i, n));
            return r.type = Rt.CANVAS,
            r._contextOptions = Object.assign({
                alpha: r.transparent
            }, Je.extraContextAttributes || {}),
            r.rootContext = r.view.getContext("2d", r._contextOptions),
            r.context = r.rootContext,
            r.refresh = !0,
            r.maskManager = new wi(r),
            r.smoothProperty = "imageSmoothingEnabled",
            r.rootContext.imageSmoothingEnabled || (r.rootContext.webkitImageSmoothingEnabled ? r.smoothProperty = "webkitImageSmoothingEnabled" : r.rootContext.mozImageSmoothingEnabled ? r.smoothProperty = "mozImageSmoothingEnabled" : r.rootContext.oImageSmoothingEnabled ? r.smoothProperty = "oImageSmoothingEnabled" : r.rootContext.msImageSmoothingEnabled && (r.smoothProperty = "msImageSmoothingEnabled")),
            r.initPlugins(),
            r.blendModes = function () {
                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
                return ki() ? (t[Dt.NORMAL] = "source-over", t[Dt.ADD] = "lighter", t[Dt.MULTIPLY] = "multiply", t[Dt.SCREEN] = "screen", t[Dt.OVERLAY] = "overlay", t[Dt.DARKEN] = "darken", t[Dt.LIGHTEN] = "lighten", t[Dt.COLOR_DODGE] = "color-dodge", t[Dt.COLOR_BURN] = "color-burn", t[Dt.HARD_LIGHT] = "hard-light", t[Dt.SOFT_LIGHT] = "soft-light", t[Dt.DIFFERENCE] = "difference", t[Dt.EXCLUSION] = "exclusion", t[Dt.HUE] = "hue", t[Dt.SATURATION] = "saturate", t[Dt.COLOR] = "color", t[Dt.LUMINOSITY] = "luminosity") : (t[Dt.NORMAL] = "source-over", t[Dt.ADD] = "lighter", t[Dt.MULTIPLY] = "source-over", t[Dt.SCREEN] = "source-over", t[Dt.OVERLAY] = "source-over", t[Dt.DARKEN] = "source-over", t[Dt.LIGHTEN] = "source-over", t[Dt.COLOR_DODGE] = "source-over", t[Dt.COLOR_BURN] = "source-over", t[Dt.HARD_LIGHT] = "source-over", t[Dt.SOFT_LIGHT] = "source-over", t[Dt.DIFFERENCE] = "source-over", t[Dt.EXCLUSION] = "source-over", t[Dt.HUE] = "source-over", t[Dt.SATURATION] = "source-over", t[Dt.COLOR] = "source-over", t[Dt.LUMINOSITY] = "source-over"),
                t[Dt.NORMAL_NPM] = t[Dt.NORMAL],
                t[Dt.ADD_NPM] = t[Dt.ADD],
                t[Dt.SCREEN_NPM] = t[Dt.SCREEN],
                t
            }
            (),
            r._activeBlendMode = null,
            r.renderingToScreen = !1,
            r.resize(r.options.width, r.options.height),
            r
        }
        return m(e, Ti),
        g(e, [{
                    key: "render",
                    value: function (t, e, i, n, r) {
                        if (this.view) {
                            this.renderingToScreen = !e,
                            this.emit("prerender");
                            var s = this.resolution;
                            e ? ((e = e.baseTexture || e)._canvasRenderTarget || (e._canvasRenderTarget = new bi(e.width, e.height, e.resolution), e.source = e._canvasRenderTarget.canvas, e.valid = !0), this.context = e._canvasRenderTarget.context, this.resolution = e._canvasRenderTarget.resolution) : this.context = this.rootContext;
                            var a = this.context;
                            if (e || (this._lastObjectRendered = t), !r) {
                                var o = t.parent,
                                h = this._tempDisplayObjectParent.transform.worldTransform;
                                n ? (n.copy(h), this._tempDisplayObjectParent.transform._worldID = -1) : h.identity(),
                                t.parent = this._tempDisplayObjectParent,
                                t.updateTransform(),
                                t.parent = o
                            }
                            a.save(),
                            a.setTransform(1, 0, 0, 1, 0, 0),
                            a.globalAlpha = 1,
                            this._activeBlendMode = Dt.NORMAL,
                            a.globalCompositeOperation = this.blendModes[Dt.NORMAL],
                            (void 0 !== i ? i : this.clearBeforeRender) && this.renderingToScreen && (this.transparent ? a.clearRect(0, 0, this.width, this.height) : (a.fillStyle = this._backgroundColorString, a.fillRect(0, 0, this.width, this.height)));
                            var u = this.context;
                            this.context = a,
                            t.renderCanvas(this),
                            this.context = u,
                            a.restore(),
                            this.resolution = s,
                            this.emit("postrender")
                        }
                    }
                }, {
                    key: "clear",
                    value: function (t) {
                        var e = this.context;
                        t = t || this._backgroundColorString,
                        !this.transparent && t ? (e.fillStyle = t, e.fillRect(0, 0, this.width, this.height)) : e.clearRect(0, 0, this.width, this.height)
                    }
                }, {
                    key: "setBlendMode",
                    value: function (t) {
                        this._activeBlendMode !== t && (this._activeBlendMode = t, this.context.globalCompositeOperation = this.blendModes[t])
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        this.destroyPlugins(),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, t),
                        this.context = null,
                        this.refresh = !0,
                        this.maskManager.destroy(),
                        this.maskManager = null,
                        this.smoothProperty = null
                    }
                }, {
                    key: "resize",
                    value: function (t, i) {
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "resize", this).call(this, t, i),
                        this.smoothProperty && (this.rootContext[this.smoothProperty] = Ze.SCALE_MODE === Ft.LINEAR)
                    }
                }, {
                    key: "invalidateBlendMode",
                    value: function () {
                        this._activeBlendMode = this.blendModes.indexOf(this.context.globalCompositeOperation)
                    }
                }
            ]),
        e
    }
    ();
    ae.mixin(Si);
    var Ci = function () {
        function t(e) {
            p(this, t),
            this.renderer = e,
            this.renderer.on("context", this.onContextChange, this)
        }
        return g(t, [{
                    key: "onContextChange",
                    value: function () {}
                }, {
                    key: "destroy",
                    value: function () {
                        this.renderer.off("context", this.onContextChange, this),
                        this.renderer = null
                    }
                }
            ]),
        t
    }
    ();
    function Oi(t, e, i) {
        var n = void 0;
        if (i) {
            var r = i.tempAttribState,
            s = i.attribState;
            for (n = 0; n < r.length; n++)
                r[n] = !1;
            for (n = 0; n < e.length; n++)
                r[e[n].attribute.location] = !0;
            for (n = 0; n < s.length; n++)
                s[n] !== r[n] && (s[n] = r[n], i.attribState[n] ? t.enableVertexAttribArray(n) : t.disableVertexAttribArray(n))
        } else
            for (n = 0; n < e.length; n++) {
                var a = e[n];
                t.enableVertexAttribArray(a.attribute.location)
            }
    }
    var Pi = new ArrayBuffer(0),
    Mi = function () {
        function t(e, i, n, r) {
            p(this, t),
            this.gl = e,
            this.buffer = e.createBuffer(),
            this.type = i || e.ARRAY_BUFFER,
            this.drawType = r || e.STATIC_DRAW,
            this.data = Pi,
            n && this.upload(n),
            this._updateID = 0
        }
        return g(t, [{
                    key: "upload",
                    value: function (t, e, i) {
                        i || this.bind();
                        var n = this.gl;
                        t = t || this.data,
                        e = e || 0,
                        this.data.byteLength >= t.byteLength ? n.bufferSubData(this.type, e, t) : n.bufferData(this.type, t, this.drawType),
                        this.data = t
                    }
                }, {
                    key: "bind",
                    value: function () {
                        this.gl.bindBuffer(this.type, this.buffer)
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.gl.deleteBuffer(this.buffer)
                    }
                }
            ], [{
                    key: "createVertexBuffer",
                    value: function (e, i, n) {
                        return new t(e, e.ARRAY_BUFFER, i, n)
                    }
                }, {
                    key: "createIndexBuffer",
                    value: function (e, i, n) {
                        return new t(e, e.ELEMENT_ARRAY_BUFFER, i, n)
                    }
                }, {
                    key: "create",
                    value: function (e, i, n, r) {
                        return new t(e, i, n, r)
                    }
                }
            ]),
        t
    }
    (),
    Ai = !1,
    Ii = function () {
        function t(e, i, n, r, s) {
            p(this, t),
            this.gl = e,
            this.texture = e.createTexture(),
            this.mipmap = !1,
            this.premultiplyAlpha = !1,
            this.width = i || -1,
            this.height = n || -1,
            this.format = r || e.RGBA,
            this.type = s || e.UNSIGNED_BYTE
        }
        return g(t, [{
                    key: "upload",
                    value: function (t) {
                        this.bind();
                        var e = this.gl;
                        e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
                        var i = t.videoWidth || t.width,
                        n = t.videoHeight || t.height;
                        n !== this.height || i !== this.width ? e.texImage2D(e.TEXTURE_2D, 0, this.format, this.format, this.type, t) : e.texSubImage2D(e.TEXTURE_2D, 0, 0, 0, this.format, this.type, t),
                        this.width = i,
                        this.height = n
                    }
                }, {
                    key: "uploadData",
                    value: function (t, e, i) {
                        this.bind();
                        var n = this.gl;
                        if (t instanceof Float32Array) {
                            if (!Ai) {
                                if (!n.getExtension("OES_texture_float"))
                                    throw new Error("floating point textures not available");
                                Ai = !0
                            }
                            this.type = n.FLOAT
                        } else
                            this.type = this.type || n.UNSIGNED_BYTE;
                        n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha),
                        e !== this.width || i !== this.height ? n.texImage2D(n.TEXTURE_2D, 0, this.format, e, i, 0, this.format, this.type, t || null) : n.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, e, i, this.format, this.type, t || null),
                        this.width = e,
                        this.height = i
                    }
                }, {
                    key: "bind",
                    value: function (t) {
                        var e = this.gl;
                        void 0 !== t && e.activeTexture(e.TEXTURE0 + t),
                        e.bindTexture(e.TEXTURE_2D, this.texture)
                    }
                }, {
                    key: "unbind",
                    value: function () {
                        var t = this.gl;
                        t.bindTexture(t.TEXTURE_2D, null)
                    }
                }, {
                    key: "minFilter",
                    value: function (t) {
                        var e = this.gl;
                        this.bind(),
                        this.mipmap ? e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, t ? e.LINEAR_MIPMAP_LINEAR : e.NEAREST_MIPMAP_NEAREST) : e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, t ? e.LINEAR : e.NEAREST)
                    }
                }, {
                    key: "magFilter",
                    value: function (t) {
                        var e = this.gl;
                        this.bind(),
                        e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, t ? e.LINEAR : e.NEAREST)
                    }
                }, {
                    key: "enableMipmap",
                    value: function () {
                        var t = this.gl;
                        this.bind(),
                        this.mipmap = !0,
                        t.generateMipmap(t.TEXTURE_2D)
                    }
                }, {
                    key: "enableLinearScaling",
                    value: function () {
                        this.minFilter(!0),
                        this.magFilter(!0)
                    }
                }, {
                    key: "enableNearestScaling",
                    value: function () {
                        this.minFilter(!1),
                        this.magFilter(!1)
                    }
                }, {
                    key: "enableWrapClamp",
                    value: function () {
                        var t = this.gl;
                        this.bind(),
                        t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE),
                        t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE)
                    }
                }, {
                    key: "enableWrapRepeat",
                    value: function () {
                        var t = this.gl;
                        this.bind(),
                        t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.REPEAT),
                        t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.REPEAT)
                    }
                }, {
                    key: "enableWrapMirrorRepeat",
                    value: function () {
                        var t = this.gl;
                        this.bind(),
                        t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.MIRRORED_REPEAT),
                        t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.MIRRORED_REPEAT)
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.gl.deleteTexture(this.texture)
                    }
                }
            ], [{
                    key: "fromSource",
                    value: function (e, i, n) {
                        var r = new t(e);
                        return r.premultiplyAlpha = n || !1,
                        r.upload(i),
                        r
                    }
                }, {
                    key: "fromData",
                    value: function (e, i, n, r) {
                        var s = new t(e);
                        return s.uploadData(i, n, r),
                        s
                    }
                }
            ]),
        t
    }
    (),
    Ri = function () {
        function t(e, i, n) {
            p(this, t),
            this.gl = e,
            this.framebuffer = e.createFramebuffer(),
            this.stencil = null,
            this.texture = null,
            this.width = i || 100,
            this.height = n || 100
        }
        return g(t, [{
                    key: "enableTexture",
                    value: function (t) {
                        var e = this.gl;
                        this.texture = t || new Ii(e),
                        this.texture.bind(),
                        this.bind(),
                        e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, this.texture.texture, 0)
                    }
                }, {
                    key: "enableStencil",
                    value: function () {
                        if (!this.stencil) {
                            var t = this.gl;
                            this.stencil = t.createRenderbuffer(),
                            t.bindRenderbuffer(t.RENDERBUFFER, this.stencil),
                            t.framebufferRenderbuffer(t.FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, t.RENDERBUFFER, this.stencil),
                            t.renderbufferStorage(t.RENDERBUFFER, t.DEPTH_STENCIL, this.width, this.height)
                        }
                    }
                }, {
                    key: "clear",
                    value: function (t, e, i, n) {
                        this.bind();
                        var r = this.gl;
                        r.clearColor(t, e, i, n),
                        r.clear(r.COLOR_BUFFER_BIT | r.DEPTH_BUFFER_BIT)
                    }
                }, {
                    key: "bind",
                    value: function () {
                        var t = this.gl;
                        t.bindFramebuffer(t.FRAMEBUFFER, this.framebuffer)
                    }
                }, {
                    key: "unbind",
                    value: function () {
                        var t = this.gl;
                        t.bindFramebuffer(t.FRAMEBUFFER, null)
                    }
                }, {
                    key: "resize",
                    value: function (t, e) {
                        var i = this.gl;
                        this.width = t,
                        this.height = e,
                        this.texture && this.texture.uploadData(null, t, e),
                        this.stencil && (i.bindRenderbuffer(i.RENDERBUFFER, this.stencil), i.renderbufferStorage(i.RENDERBUFFER, i.DEPTH_STENCIL, t, e))
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        var t = this.gl;
                        this.texture && this.texture.destroy(),
                        t.deleteFramebuffer(this.framebuffer),
                        this.gl = null,
                        this.stencil = null,
                        this.texture = null
                    }
                }
            ], [{
                    key: "createRGBA",
                    value: function (e, i, n, r) {
                        var s = Ii.fromData(e, null, i, n);
                        s.enableNearestScaling(),
                        s.enableWrapClamp();
                        var a = new t(e, i, n);
                        return a.enableTexture(s),
                        a.unbind(),
                        a
                    }
                }, {
                    key: "createFloat32",
                    value: function (e, i, n, r) {
                        var s = Ii.fromData(e, r, i, n);
                        s.enableNearestScaling(),
                        s.enableWrapClamp();
                        var a = new t(e, i, n);
                        return a.enableTexture(s),
                        a.unbind(),
                        a
                    }
                }
            ]),
        t
    }
    ();
    var Di = function (t, e, i) {
        var n = t.createShader(e);
        return t.shaderSource(n, i),
        t.compileShader(n),
        t.getShaderParameter(n, t.COMPILE_STATUS) ? n : (console.error("An error occurred compiling the shaders: " + t.getShaderInfoLog(n)), null)
    },
    Li = function (t) {
        for (var e = new Array(t), i = 0; i < e.length; i++)
            e[i] = !1;
        return e
    };
    function Fi(t, e) {
        switch (t) {
        case "float":
            return 0;
        case "vec2":
            return new Float32Array(2 * e);
        case "vec3":
            return new Float32Array(3 * e);
        case "vec4":
            return new Float32Array(4 * e);
        case "int":
        case "sampler2D":
            return 0;
        case "ivec2":
            return new Int32Array(2 * e);
        case "ivec3":
            return new Int32Array(3 * e);
        case "ivec4":
            return new Int32Array(4 * e);
        case "bool":
            return !1;
        case "bvec2":
            return Li(2 * e);
        case "bvec3":
            return Li(3 * e);
        case "bvec4":
            return Li(4 * e);
        case "mat2":
            return new Float32Array([1, 0, 0, 1]);
        case "mat3":
            return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
        case "mat4":
            return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
        }
    }
    var Ni = {
        FLOAT: "float",
        FLOAT_VEC2: "vec2",
        FLOAT_VEC3: "vec3",
        FLOAT_VEC4: "vec4",
        INT: "int",
        INT_VEC2: "ivec2",
        INT_VEC3: "ivec3",
        INT_VEC4: "ivec4",
        BOOL: "bool",
        BOOL_VEC2: "bvec2",
        BOOL_VEC3: "bvec3",
        BOOL_VEC4: "bvec4",
        FLOAT_MAT2: "mat2",
        FLOAT_MAT3: "mat3",
        FLOAT_MAT4: "mat4",
        SAMPLER_2D: "sampler2D"
    },
    Ui = null;
    function Bi(t, e) {
        if (!Ui) {
            var i = Object.keys(Ni);
            Ui = {};
            for (var n = 0; n < i.length; ++n) {
                var r = i[n];
                Ui[t[r]] = Ni[r]
            }
        }
        return Ui[e]
    }
    var Xi = {
        float: 1,
        vec2: 2,
        vec3: 3,
        vec4: 4,
        int: 1,
        ivec2: 2,
        ivec3: 3,
        ivec4: 4,
        bool: 1,
        bvec2: 2,
        bvec3: 3,
        bvec4: 4,
        mat2: 4,
        mat3: 9,
        mat4: 16,
        sampler2D: 1
    };
    function ji(t) {
        return Xi[t]
    }
    var Gi = {
        float: function (t, e, i) {
            t.uniform1f(e, i)
        },
        vec2: function (t, e, i) {
            t.uniform2f(e, i[0], i[1])
        },
        vec3: function (t, e, i) {
            t.uniform3f(e, i[0], i[1], i[2])
        },
        vec4: function (t, e, i) {
            t.uniform4f(e, i[0], i[1], i[2], i[3])
        },
        int: function (t, e, i) {
            t.uniform1i(e, i)
        },
        ivec2: function (t, e, i) {
            t.uniform2i(e, i[0], i[1])
        },
        ivec3: function (t, e, i) {
            t.uniform3i(e, i[0], i[1], i[2])
        },
        ivec4: function (t, e, i) {
            t.uniform4i(e, i[0], i[1], i[2], i[3])
        },
        bool: function (t, e, i) {
            t.uniform1i(e, i)
        },
        bvec2: function (t, e, i) {
            t.uniform2i(e, i[0], i[1])
        },
        bvec3: function (t, e, i) {
            t.uniform3i(e, i[0], i[1], i[2])
        },
        bvec4: function (t, e, i) {
            t.uniform4i(e, i[0], i[1], i[2], i[3])
        },
        mat2: function (t, e, i) {
            t.uniformMatrix2fv(e, !1, i)
        },
        mat3: function (t, e, i) {
            t.uniformMatrix3fv(e, !1, i)
        },
        mat4: function (t, e, i) {
            t.uniformMatrix4fv(e, !1, i)
        },
        sampler2D: function (t, e, i) {
            t.uniform1i(e, i)
        }
    },
    Wi = {
        float: function (t, e, i) {
            t.uniform1fv(e, i)
        },
        vec2: function (t, e, i) {
            t.uniform2fv(e, i)
        },
        vec3: function (t, e, i) {
            t.uniform3fv(e, i)
        },
        vec4: function (t, e, i) {
            t.uniform4fv(e, i)
        },
        int: function (t, e, i) {
            t.uniform1iv(e, i)
        },
        ivec2: function (t, e, i) {
            t.uniform2iv(e, i)
        },
        ivec3: function (t, e, i) {
            t.uniform3iv(e, i)
        },
        ivec4: function (t, e, i) {
            t.uniform4iv(e, i)
        },
        bool: function (t, e, i) {
            t.uniform1iv(e, i)
        },
        bvec2: function (t, e, i) {
            t.uniform2iv(e, i)
        },
        bvec3: function (t, e, i) {
            t.uniform3iv(e, i)
        },
        bvec4: function (t, e, i) {
            t.uniform4iv(e, i)
        },
        sampler2D: function (t, e, i) {
            t.uniform1iv(e, i)
        }
    },
    Yi = function (t) {
        return function () {
            return this.data[t].value
        }
    };
    function Hi(t, e) {
        return function (i) {
            this.data[t].value = i;
            var n = this.data[t].location;
            1 === e.size ? Gi[e.type](this.gl, n, i) : Wi[e.type](this.gl, n, i)
        }
    }
    function Vi(t, e) {
        for (var i = e, n = 0; n < t.length - 1; n++) {
            var r = i[t[n]] || {
                data: {}
            };
            i[t[n]] = r,
            i = r
        }
        return i
    }
    var zi = {
        compileProgram: function (t, e, i, n) {
            var r = Di(t, t.VERTEX_SHADER, e),
            s = Di(t, t.FRAGMENT_SHADER, i),
            a = t.createProgram();
            if (t.attachShader(a, r), t.attachShader(a, s), n)
                for (var o in n)
                    t.bindAttribLocation(a, n[o], o);
            return t.linkProgram(a),
            t.getProgramParameter(a, t.LINK_STATUS) || (console.error("Error: Could not initialize shader."), console.error("gl.VALIDATE_STATUS", t.getProgramParameter(a, t.VALIDATE_STATUS)), console.error("gl.getError()", t.getError()), "" !== t.getProgramInfoLog(a) && console.warn("Warning: gl.getProgramInfoLog()", t.getProgramInfoLog(a)), t.deleteProgram(a), a = null),
            t.deleteShader(r),
            t.deleteShader(s),
            a
        },
        defaultValue: Fi,
        extractAttributes: function (t, e) {
            for (var i = {}, n = t.getProgramParameter(e, t.ACTIVE_ATTRIBUTES), r = function (e, i, n, r) {
                t.vertexAttribPointer(this.location, this.size, e || t.FLOAT, i || !1, n || 0, r || 0)
            }, s = 0; s < n; s++) {
                var a = t.getActiveAttrib(e, s),
                o = Bi(t, a.type);
                i[a.name] = {
                    type: o,
                    size: ji(o),
                    location: t.getAttribLocation(e, a.name),
                    pointer: r
                }
            }
            return i
        },
        extractUniforms: function (t, e) {
            for (var i = {}, n = t.getProgramParameter(e, t.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
                var s = t.getActiveUniform(e, r),
                a = s.name.replace(/\[.*?\]/, ""),
                o = Bi(t, s.type);
                i[a] = {
                    type: o,
                    size: s.size,
                    location: t.getUniformLocation(e, a),
                    value: Fi(o, s.size)
                }
            }
            return i
        },
        generateUniformAccessObject: function (t, e) {
            var i = {
                data: {}
            };
            i.gl = t;
            for (var n = Object.keys(e), r = 0; r < n.length; r++) {
                var s = n[r],
                a = s.split("."),
                o = a[a.length - 1],
                h = Vi(a, i),
                u = e[s];
                h.data[o] = u,
                h.gl = t,
                Object.defineProperty(h, o, {
                    get: Yi(o),
                    set: Hi(o, u)
                })
            }
            return i
        },
        setPrecision: function (t, e) {
            if ((t = t.replace(/^\s*/, ""))instanceof Array) {
                if ("precision" !== t[0].substring(0, 9)) {
                    var i = t.slice(0);
                    return i.unshift("precision " + e + " float;"),
                    i
                }
            } else if ("precision" !== t.substring(0, 9))
                return "precision " + e + " float;\n" + t;
            return t
        },
        mapSize: ji,
        mapType: Bi
    },
    qi = zi.compileProgram,
    Ki = zi.extractAttributes,
    Zi = zi.extractUniforms,
    Ji = zi.setPrecision,
    Qi = zi.generateUniformAccessObject,
    $i = function () {
        function t(e, i, n, r, s) {
            p(this, t),
            this.gl = e,
            r && (i = Ji(i, r), n = Ji(n, r)),
            this.program = qi(e, i, n, s),
            this.attributes = Ki(e, this.program),
            this.uniformData = Zi(e, this.program),
            this.uniforms = Qi(e, this.uniformData)
        }
        return g(t, [{
                    key: "bind",
                    value: function () {
                        return this.gl.useProgram(this.program),
                        this
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.attributes = null,
                        this.uniformData = null,
                        this.uniforms = null,
                        this.gl.deleteProgram(this.program)
                    }
                }
            ]),
        t
    }
    (),
    tn = function () {
        function t(e, i) {
            if (p(this, t), this.nativeVaoExtension = null, t.FORCE_NATIVE || (this.nativeVaoExtension = e.getExtension("OES_vertex_array_object") || e.getExtension("MOZ_OES_vertex_array_object") || e.getExtension("WEBKIT_OES_vertex_array_object")), this.nativeState = i, this.nativeVaoExtension) {
                this.nativeVao = this.nativeVaoExtension.createVertexArrayOES();
                var n = e.getParameter(e.MAX_VERTEX_ATTRIBS);
                this.nativeState = {
                    tempAttribState: new Array(n),
                    attribState: new Array(n)
                }
            }
            this.gl = e,
            this.attributes = [],
            this.indexBuffer = null,
            this.dirty = !1
        }
        return g(t, [{
                    key: "bind",
                    value: function () {
                        if (this.nativeVao) {
                            if (this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao), this.dirty)
                                return this.dirty = !1, this.activate(), this;
                            this.indexBuffer && this.indexBuffer.bind()
                        } else
                            this.activate();
                        return this
                    }
                }, {
                    key: "unbind",
                    value: function () {
                        return this.nativeVao && this.nativeVaoExtension.bindVertexArrayOES(null),
                        this
                    }
                }, {
                    key: "activate",
                    value: function () {
                        for (var t = this.gl, e = null, i = 0; i < this.attributes.length; i++) {
                            var n = this.attributes[i];
                            e !== n.buffer && (n.buffer.bind(), e = n.buffer),
                            t.vertexAttribPointer(n.attribute.location, n.attribute.size, n.type || t.FLOAT, n.normalized || !1, n.stride || 0, n.start || 0)
                        }
                        return Oi(t, this.attributes, this.nativeState),
                        this.indexBuffer && this.indexBuffer.bind(),
                        this
                    }
                }, {
                    key: "addAttribute",
                    value: function (t, e, i, n, r, s) {
                        return this.attributes.push({
                            buffer: t,
                            attribute: e,
                            location: e.location,
                            type: i || this.gl.FLOAT,
                            normalized: n || !1,
                            stride: r || 0,
                            start: s || 0
                        }),
                        this.dirty = !0,
                        this
                    }
                }, {
                    key: "addIndex",
                    value: function (t) {
                        return this.indexBuffer = t,
                        this.dirty = !0,
                        this
                    }
                }, {
                    key: "clear",
                    value: function () {
                        return this.nativeVao && this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),
                        this.attributes.length = 0,
                        this.indexBuffer = null,
                        this
                    }
                }, {
                    key: "draw",
                    value: function (t, e, i) {
                        var n = this.gl;
                        return this.indexBuffer ? n.drawElements(t, e || this.indexBuffer.data.length, n.UNSIGNED_SHORT, 2 * (i || 0)) : n.drawArrays(t, i, e || this.getSize()),
                        this
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.gl = null,
                        this.indexBuffer = null,
                        this.attributes = null,
                        this.nativeState = null,
                        this.nativeVao && this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao),
                        this.nativeVaoExtension = null,
                        this.nativeVao = null
                    }
                }, {
                    key: "getSize",
                    value: function () {
                        var t = this.attributes[0];
                        return t.buffer.data.length / (t.stride / 4 || t.attribute.size)
                    }
                }
            ]),
        t
    }
    ();
    tn.FORCE_NATIVE = !1;
    var en = {
        createContext: function (t, e) {
            var i = t.getContext("webgl", e) || t.getContext("experimental-webgl", e);
            if (!i)
                throw new Error("This browser does not support webGL. Try using the canvas renderer");
            return i
        },
        setVertexAttribArrays: Oi,
        GLBuffer: Mi,
        GLFramebuffer: Ri,
        GLShader: $i,
        GLTexture: Ii,
        VertexArrayObject: tn,
        shader: zi
    },
    nn = en.shader.defaultValue;
    function rn(t) {
        for (var e = new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"), i = {}, n = void 0, r = t.replace(/\s+/g, " ").split(/\s*;\s*/), s = 0; s < r.length; s++) {
            var a = r[s].trim();
            if (a.indexOf("uniform") > -1) {
                var o = a.split(" "),
                h = o[1],
                u = o[2],
                l = 1;
                u.indexOf("[") > -1 && (u = (n = u.split(/\[|]/))[0], l *= Number(n[1])),
                u.match(e) || (i[u] = {
                        value: nn(h, l),
                        name: u,
                        type: h
                    })
            }
        }
        return i
    }
    var sn = {},
    an = function () {
        function t(e, i, n) {
            for (var r in p(this, t), this.vertexSrc = e || t.defaultVertexSrc, this.fragmentSrc = i || t.defaultFragmentSrc, this._blendMode = Dt.NORMAL, this.uniformData = n || function (t, e, i) {
                var n = rn(t),
                r = rn(e);
                return Object.assign(n, r)
            }
                (this.vertexSrc, this.fragmentSrc), this.uniforms = {}, this.uniformData)
                this.uniforms[r] = this.uniformData[r].value, this.uniformData[r].type && (this.uniformData[r].type = this.uniformData[r].type.toLowerCase());
            this.glShaders = {},
            sn[this.vertexSrc + this.fragmentSrc] || (sn[this.vertexSrc + this.fragmentSrc] = Xe()),
            this.glShaderKey = sn[this.vertexSrc + this.fragmentSrc],
            this.padding = 4,
            this.resolution = Ze.FILTER_RESOLUTION,
            this.enabled = !0,
            this.autoFit = !0
        }
        return g(t, [{
                    key: "apply",
                    value: function (t, e, i, n, r) {
                        t.applyFilter(this, e, i, n)
                    }
                }, {
                    key: "blendMode",
                    get: function () {
                        return this._blendMode
                    },
                    set: function (t) {
                        this._blendMode = t
                    }
                }
            ], [{
                    key: "defaultVertexSrc",
                    get: function () {
                        return "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nvoid main(void){\n  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n  vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n  vTextureCoord = aTextureCoord ;\n}\n"
                    }
                }, {
                    key: "defaultFragmentSrc",
                    get: function () {
                        return "\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D filterSampler;\n\nvoid main(void){\n  vec4 masky = texture2D(filterSampler, vFilterCoord);\n  vec4 sample = texture2D(uSampler, vTextureCoord);\n  vec4 color;\n  if(mod(vFilterCoord.x, 1.0) > 0.5) {\n    color = vec4(1.0, 0.0, 0.0, 1.0);\n  } else {\n    color = vec4(0.0, 1.0, 0.0, 1.0);\n  }\n  gl_FragColor = mix(sample, masky, 0.5);\n  gl_FragColor *= sample.a;',\n}\n"
                    }
                }
            ]),
        t
    }
    (),
    on = new Vt,
    hn = function () {
        function t(e, i) {
            p(this, t),
            this._texture = e,
            this.mapCoord = new Vt,
            this.uClampFrame = new Float32Array(4),
            this.uClampOffset = new Float32Array(2),
            this._lastTextureID = -1,
            this.clampOffset = 0,
            this.clampMargin = void 0 === i ? .5 : i
        }
        return g(t, [{
                    key: "multiplyUvs",
                    value: function (t, e) {
                        void 0 === e && (e = t);
                        for (var i = this.mapCoord, n = 0; n < t.length; n += 2) {
                            var r = t[n],
                            s = t[n + 1];
                            e[n] = r * i.a + s * i.c + i.tx,
                            e[n + 1] = r * i.b + s * i.d + i.ty
                        }
                        return e
                    }
                }, {
                    key: "update",
                    value: function (t) {
                        var e = this._texture;
                        if (!e || !e.valid)
                            return !1;
                        if (!t && this._lastTextureID === e._updateID)
                            return !1;
                        this._lastTextureID = e._updateID;
                        var i = e._uvs;
                        this.mapCoord.set(i.x1 - i.x0, i.y1 - i.y0, i.x3 - i.x0, i.y3 - i.y0, i.x0, i.y0);
                        var n = e.orig,
                        r = e.trim;
                        r && (on.set(n.width / r.width, 0, 0, n.height / r.height, -r.x / r.width, -r.y / r.height), this.mapCoord.append(on));
                        var s = e.baseTexture,
                        a = this.uClampFrame,
                        o = this.clampMargin / s.resolution,
                        h = this.clampOffset;
                        return a[0] = (e._frame.x + o + h) / s.width,
                        a[1] = (e._frame.y + o + h) / s.height,
                        a[2] = (e._frame.x + e._frame.width - o + h) / s.width,
                        a[3] = (e._frame.y + e._frame.height - o + h) / s.height,
                        this.uClampOffset[0] = h / s.realWidth,
                        this.uClampOffset[1] = h / s.realHeight,
                        !0
                    }
                }, {
                    key: "texture",
                    get: function () {
                        return this._texture
                    },
                    set: function (t) {
                        this._texture = t,
                        this._lastTextureID = -1
                    }
                }
            ]),
        t
    }
    (),
    un = {
        frag: "\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n  float clip = step(3.5,\n    step(maskClamp.x, vMaskCoord.x) +\n    step(maskClamp.y, vMaskCoord.y) +\n    step(vMaskCoord.x, maskClamp.z) +\n    step(vMaskCoord.y, maskClamp.w));\n\n  vec4 original = texture2D(uSampler, vTextureCoord);\n  vec4 masky = texture2D(mask, vMaskCoord);\n\n  original *= (masky.r * masky.a * alpha * clip);\n\n  gl_FragColor = original;\n}\n",
        vert: "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n"
    },
    ln = function (t) {
        function e(t) {
            p(this, e);
            var i = new Vt,
            n = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, un.vert, un.frag));
            return t.renderable = !1,
            n.maskSprite = t,
            n.maskMatrix = i,
            n
        }
        return m(e, an),
        g(e, [{
                    key: "apply",
                    value: function (t, e, i) {
                        var n = this.maskSprite,
                        r = this.maskSprite.texture;
                        r.valid && (r.transform || (r.transform = new hn(r, 0)), r.transform.update(), this.uniforms.mask = r, this.uniforms.otherMatrix = t.calculateSpriteMatrix(this.maskMatrix, n).prepend(r.transform.mapCoord), this.uniforms.alpha = n.worldAlpha, this.uniforms.maskClamp = r.transform.uClampFrame, t.applyFilter(this, e, i))
                    }
                }
            ]),
        e
    }
    (),
    cn = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
            return i.scissor = !1,
            i.scissorData = null,
            i.scissorRenderTarget = null,
            i.enableScissor = !0,
            i.alphaMaskPool = [],
            i.alphaMaskIndex = 0,
            i
        }
        return m(e, Ci),
        g(e, [{
                    key: "pushMask",
                    value: function (t, e) {
                        if (e.texture)
                            this.pushSpriteMask(t, e);
                        else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && e.isFastRect()) {
                            var i = e.worldTransform,
                            n = Math.atan2(i.b, i.a);
                            (n = Math.round(n * (180 / Math.PI))) % 90 ? this.pushStencilMask(e) : this.pushScissorMask(t, e)
                        } else
                            this.pushStencilMask(e)
                    }
                }, {
                    key: "popMask",
                    value: function (t, e) {
                        e.texture ? this.popSpriteMask(t, e) : this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length ? this.popScissorMask(t, e) : this.popStencilMask(t, e)
                    }
                }, {
                    key: "pushSpriteMask",
                    value: function (t, e) {
                        var i = this.alphaMaskPool[this.alphaMaskIndex];
                        i || (i = this.alphaMaskPool[this.alphaMaskIndex] = [new ln(e)]),
                        i[0].resolution = this.renderer.resolution,
                        i[0].maskSprite = e,
                        t.filterArea = e.getBounds(!0),
                        this.renderer.filterManager.pushFilter(t, i),
                        this.alphaMaskIndex++
                    }
                }, {
                    key: "popSpriteMask",
                    value: function () {
                        this.renderer.filterManager.popFilter(),
                        this.alphaMaskIndex--
                    }
                }, {
                    key: "pushStencilMask",
                    value: function (t) {
                        this.renderer.currentRenderer.stop(),
                        this.renderer.stencilManager.pushStencil(t)
                    }
                }, {
                    key: "popStencilMask",
                    value: function () {
                        this.renderer.currentRenderer.stop(),
                        this.renderer.stencilManager.popStencil()
                    }
                }, {
                    key: "pushScissorMask",
                    value: function (t, e) {
                        e.renderable = !0;
                        var i = this.renderer._activeRenderTarget,
                        n = e.getBounds();
                        n.fit(i.size),
                        e.renderable = !1,
                        this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);
                        var r = this.renderer.resolution;
                        this.renderer.gl.scissor(n.x * r, (i.root ? i.size.height - n.y - n.height : n.y) * r, n.width * r, n.height * r),
                        this.scissorRenderTarget = i,
                        this.scissorData = e,
                        this.scissor = !0
                    }
                }, {
                    key: "popScissorMask",
                    value: function () {
                        this.scissorRenderTarget = null,
                        this.scissorData = null,
                        this.scissor = !1;
                        var t = this.renderer.gl;
                        t.disable(t.SCISSOR_TEST)
                    }
                }
            ]),
        e
    }
    (),
    dn = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
            return i.stencilMaskStack = null,
            i
        }
        return m(e, Ci),
        g(e, [{
                    key: "setMaskStack",
                    value: function (t) {
                        this.stencilMaskStack = t;
                        var e = this.renderer.gl;
                        0 === t.length ? e.disable(e.STENCIL_TEST) : e.enable(e.STENCIL_TEST)
                    }
                }, {
                    key: "pushStencil",
                    value: function (t) {
                        this.renderer.setObjectRenderer(this.renderer.plugins.graphics),
                        this.renderer._activeRenderTarget.attachStencilBuffer();
                        var e = this.renderer.gl,
                        i = this.stencilMaskStack.length;
                        0 === i && e.enable(e.STENCIL_TEST),
                        this.stencilMaskStack.push(t),
                        e.colorMask(!1, !1, !1, !1),
                        e.stencilFunc(e.EQUAL, i, this._getBitwiseMask()),
                        e.stencilOp(e.KEEP, e.KEEP, e.INCR),
                        this.renderer.plugins.graphics.render(t),
                        this._useCurrent()
                    }
                }, {
                    key: "popStencil",
                    value: function () {
                        this.renderer.setObjectRenderer(this.renderer.plugins.graphics);
                        var t = this.renderer.gl,
                        e = this.stencilMaskStack.pop();
                        0 === this.stencilMaskStack.length ? (t.disable(t.STENCIL_TEST), t.clear(t.STENCIL_BUFFER_BIT), t.clearStencil(0)) : (t.colorMask(!1, !1, !1, !1), t.stencilOp(t.KEEP, t.KEEP, t.DECR), this.renderer.plugins.graphics.render(e), this._useCurrent())
                    }
                }, {
                    key: "_useCurrent",
                    value: function () {
                        var t = this.renderer.gl;
                        t.colorMask(!0, !0, !0, !0),
                        t.stencilFunc(t.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask()),
                        t.stencilOp(t.KEEP, t.KEEP, t.KEEP)
                    }
                }, {
                    key: "_getBitwiseMask",
                    value: function () {
                        return (1 << this.stencilMaskStack.length) - 1
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        Ci.prototype.destroy.call(this),
                        this.stencilMaskStack.stencilStack = null
                    }
                }
            ]),
        e
    }
    (),
    fn = function () {
        function t(e, i, n, r, s, a) {
            p(this, t),
            this.gl = e,
            this.frameBuffer = null,
            this.texture = null,
            this.clearColor = [0, 0, 0, 0],
            this.size = new ee(0, 0, 1, 1),
            this.resolution = s || Ze.RESOLUTION,
            this.projectionMatrix = new Vt,
            this.transform = null,
            this.frame = null,
            this.defaultFrame = new ee,
            this.destinationFrame = null,
            this.sourceFrame = null,
            this.stencilBuffer = null,
            this.stencilMaskStack = [],
            this.filterData = null,
            this.filterPoolKey = "",
            this.scaleMode = void 0 !== r ? r : Ze.SCALE_MODE,
            this.root = a,
            this.root ? (this.frameBuffer = new Ri(e, 100, 100), this.frameBuffer.framebuffer = null) : (this.frameBuffer = Ri.createRGBA(e, 100, 100), this.scaleMode === Ft.NEAREST ? this.frameBuffer.texture.enableNearestScaling() : this.frameBuffer.texture.enableLinearScaling(), this.texture = this.frameBuffer.texture),
            this.setFrame(),
            this.resize(i, n)
        }
        return g(t, [{
                    key: "clear",
                    value: function (t) {
                        var e = t || this.clearColor;
                        this.frameBuffer.clear(e[0], e[1], e[2], e[3])
                    }
                }, {
                    key: "attachStencilBuffer",
                    value: function () {
                        this.root || this.frameBuffer.enableStencil()
                    }
                }, {
                    key: "setFrame",
                    value: function (t, e) {
                        this.destinationFrame = t || this.destinationFrame || this.defaultFrame,
                        this.sourceFrame = e || this.sourceFrame || this.destinationFrame
                    }
                }, {
                    key: "activate",
                    value: function () {
                        var t = this.gl;
                        this.frameBuffer.bind(),
                        this.calculateProjection(this.destinationFrame, this.sourceFrame),
                        this.transform && this.projectionMatrix.append(this.transform),
                        this.destinationFrame !== this.sourceFrame ? (t.enable(t.SCISSOR_TEST), t.scissor(0 | this.destinationFrame.x, 0 | this.destinationFrame.y, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0)) : t.disable(t.SCISSOR_TEST),
                        t.viewport(0 | this.destinationFrame.x, 0 | this.destinationFrame.y, this.destinationFrame.width * this.resolution | 0, this.destinationFrame.height * this.resolution | 0)
                    }
                }, {
                    key: "calculateProjection",
                    value: function (t, e) {
                        var i = this.projectionMatrix;
                        e = e || t,
                        i.identity(),
                        this.root ? (i.a = 1 / t.width * 2, i.d = -1 / t.height * 2, i.tx = -1 - e.x * i.a, i.ty = 1 - e.y * i.d) : (i.a = 1 / t.width * 2, i.d = 1 / t.height * 2, i.tx = -1 - e.x * i.a, i.ty = -1 - e.y * i.d)
                    }
                }, {
                    key: "resize",
                    value: function (t, e) {
                        if (t |= 0, e |= 0, this.size.width !== t || this.size.height !== e) {
                            this.size.width = t,
                            this.size.height = e,
                            this.defaultFrame.width = t,
                            this.defaultFrame.height = e,
                            this.frameBuffer.resize(t * this.resolution, e * this.resolution);
                            var i = this.frame || this.size;
                            this.calculateProjection(i)
                        }
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.frameBuffer.destroy(),
                        this.frameBuffer = null,
                        this.texture = null
                    }
                }
            ]),
        t
    }
    ();
    function vn(t) {
        for (var e = 6 * t, i = new Uint16Array(e), n = 0, r = 0; n < e; n += 6, r += 4)
            i[n + 0] = r + 0, i[n + 1] = r + 1, i[n + 2] = r + 2, i[n + 3] = r + 0, i[n + 4] = r + 2, i[n + 5] = r + 3;
        return i
    }
    var pn = function () {
        function t(e, i) {
            p(this, t),
            this.gl = e,
            this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]),
            this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
            this.interleaved = new Float32Array(16);
            for (var n = 0; n < 4; n++)
                this.interleaved[4 * n] = this.vertices[2 * n], this.interleaved[4 * n + 1] = this.vertices[2 * n + 1], this.interleaved[4 * n + 2] = this.uvs[2 * n], this.interleaved[4 * n + 3] = this.uvs[2 * n + 1];
            this.indices = vn(1),
            this.vertexBuffer = en.GLBuffer.createVertexBuffer(e, this.interleaved, e.STATIC_DRAW),
            this.indexBuffer = en.GLBuffer.createIndexBuffer(e, this.indices, e.STATIC_DRAW),
            this.vao = new en.VertexArrayObject(e, i)
        }
        return g(t, [{
                    key: "initVao",
                    value: function (t) {
                        this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer, t.attributes.aVertexPosition, this.gl.FLOAT, !1, 16, 0).addAttribute(this.vertexBuffer, t.attributes.aTextureCoord, this.gl.FLOAT, !1, 16, 8)
                    }
                }, {
                    key: "map",
                    value: function (t, e) {
                        var i = 0,
                        n = 0;
                        return this.uvs[0] = i,
                        this.uvs[1] = n,
                        this.uvs[2] = i + e.width / t.width,
                        this.uvs[3] = n,
                        this.uvs[4] = i + e.width / t.width,
                        this.uvs[5] = n + e.height / t.height,
                        this.uvs[6] = i,
                        this.uvs[7] = n + e.height / t.height,
                        i = e.x,
                        n = e.y,
                        this.vertices[0] = i,
                        this.vertices[1] = n,
                        this.vertices[2] = i + e.width,
                        this.vertices[3] = n,
                        this.vertices[4] = i + e.width,
                        this.vertices[5] = n + e.height,
                        this.vertices[6] = i,
                        this.vertices[7] = n + e.height,
                        this
                    }
                }, {
                    key: "upload",
                    value: function () {
                        for (var t = 0; t < 4; t++)
                            this.interleaved[4 * t] = this.vertices[2 * t], this.interleaved[4 * t + 1] = this.vertices[2 * t + 1], this.interleaved[4 * t + 2] = this.uvs[2 * t], this.interleaved[4 * t + 3] = this.uvs[2 * t + 1];
                        return this.vertexBuffer.upload(this.interleaved),
                        this
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        var t = this.gl;
                        t.deleteBuffer(this.vertexBuffer),
                        t.deleteBuffer(this.indexBuffer)
                    }
                }
            ]),
        t
    }
    (),
    gn = function (t) {
        function e(t, i, n, r, s) {
            return p(this, e),
            x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, en.shader.setPrecision(i, s || Ze.PRECISION_VERTEX), en.shader.setPrecision(n, s || Ze.PRECISION_FRAGMENT), void 0, r))
        }
        return m(e, t),
        e
    }
    (en.GLShader);
    var yn = function () {
        function t() {
            p(this, t),
            this.renderTarget = null,
            this.target = null,
            this.resolution = 1,
            this.sourceFrame = new ee,
            this.destinationFrame = new ee,
            this.filters = []
        }
        return g(t, [{
                    key: "clear",
                    value: function () {
                        this.filters = null,
                        this.target = null,
                        this.renderTarget = null
                    }
                }
            ]),
        t
    }
    (),
    _n = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
            return i.gl = i.renderer.gl,
            i.quad = new pn(i.gl, t.state.attribState),
            i.shaderCache = {},
            i.pool = {},
            i.filterData = null,
            i.managedFilters = [],
            i.renderer.on("prerender", i.onPrerender, i),
            i._screenWidth = t.view.width,
            i._screenHeight = t.view.height,
            i
        }
        return m(e, Ci),
        g(e, [{
                    key: "pushFilter",
                    value: function (t, e) {
                        var i = this.renderer,
                        n = this.filterData;
                        if (!n) {
                            n = this.renderer._activeRenderTarget.filterStack;
                            var r = new yn;
                            r.sourceFrame = r.destinationFrame = this.renderer._activeRenderTarget.size,
                            r.renderTarget = i._activeRenderTarget,
                            this.renderer._activeRenderTarget.filterData = n = {
                                index: 0,
                                stack: [r]
                            },
                            this.filterData = n
                        }
                        var s = n.stack[++n.index],
                        a = n.stack[0].destinationFrame;
                        s || (s = n.stack[n.index] = new yn);
                        var o = t.filterArea && 0 === t.filterArea.x && 0 === t.filterArea.y && t.filterArea.width === i.screen.width && t.filterArea.height === i.screen.height,
                        h = e[0].resolution,
                        u = 0 | e[0].padding,
                        l = o ? i.screen : t.filterArea || t.getBounds(!0),
                        c = s.sourceFrame,
                        d = s.destinationFrame;
                        c.x = (l.x * h | 0) / h,
                        c.y = (l.y * h | 0) / h,
                        c.width = (l.width * h | 0) / h,
                        c.height = (l.height * h | 0) / h,
                        o || (n.stack[0].renderTarget.transform || e[0].autoFit && c.fit(a), c.pad(u)),
                        d.width = c.width,
                        d.height = c.height;
                        var f = this.getPotRenderTarget(i.gl, c.width, c.height, h);
                        s.target = t,
                        s.filters = e,
                        s.resolution = h,
                        s.renderTarget = f,
                        f.setFrame(d, c),
                        i.bindRenderTarget(f),
                        f.clear()
                    }
                }, {
                    key: "popFilter",
                    value: function () {
                        var t = this.filterData,
                        e = t.stack[t.index - 1],
                        i = t.stack[t.index];
                        this.quad.map(i.renderTarget.size, i.sourceFrame).upload();
                        var n = i.filters;
                        if (1 === n.length)
                            n[0].apply(this, i.renderTarget, e.renderTarget, !1, i), this.freePotRenderTarget(i.renderTarget);
                        else {
                            var r = i.renderTarget,
                            s = this.getPotRenderTarget(this.renderer.gl, i.sourceFrame.width, i.sourceFrame.height, i.resolution);
                            s.setFrame(i.destinationFrame, i.sourceFrame),
                            s.clear();
                            var a = 0;
                            for (a = 0; a < n.length - 1; ++a) {
                                n[a].apply(this, r, s, !0, i);
                                var o = r;
                                r = s,
                                s = o
                            }
                            n[a].apply(this, r, e.renderTarget, !1, i),
                            this.freePotRenderTarget(r),
                            this.freePotRenderTarget(s)
                        }
                        i.clear(),
                        t.index--,
                        0 === t.index && (this.filterData = null)
                    }
                }, {
                    key: "applyFilter",
                    value: function (t, e, i, n) {
                        var r = this.renderer,
                        s = r.gl,
                        a = t.glShaders[r.CONTEXT_UID];
                        a || (t.glShaderKey ? (a = this.shaderCache[t.glShaderKey]) || (a = new gn(this.gl, t.vertexSrc, t.fragmentSrc), t.glShaders[r.CONTEXT_UID] = this.shaderCache[t.glShaderKey] = a, this.managedFilters.push(t)) : (a = t.glShaders[r.CONTEXT_UID] = new gn(this.gl, t.vertexSrc, t.fragmentSrc), this.managedFilters.push(t)), r.bindVao(null), this.quad.initVao(a)),
                        r.bindVao(this.quad.vao),
                        r.bindRenderTarget(i),
                        n && (s.disable(s.SCISSOR_TEST), r.clear(), s.enable(s.SCISSOR_TEST)),
                        i === r.maskManager.scissorRenderTarget && r.maskManager.pushScissorMask(null, r.maskManager.scissorData),
                        r.bindShader(a);
                        var o = this.renderer.emptyTextures[0];
                        this.renderer.boundTextures[0] = o,
                        this.syncUniforms(a, t),
                        r.state.setBlendMode(t.blendMode),
                        s.activeTexture(s.TEXTURE0),
                        s.bindTexture(s.TEXTURE_2D, e.texture.texture),
                        this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0),
                        s.bindTexture(s.TEXTURE_2D, o._glTextures[this.renderer.CONTEXT_UID].texture)
                    }
                }, {
                    key: "syncUniforms",
                    value: function (t, e) {
                        var i = e.uniformData,
                        n = e.uniforms,
                        r = 1,
                        s = void 0;
                        if (t.uniforms.filterArea) {
                            s = this.filterData.stack[this.filterData.index];
                            var a = t.uniforms.filterArea;
                            a[0] = s.renderTarget.size.width,
                            a[1] = s.renderTarget.size.height,
                            a[2] = s.sourceFrame.x,
                            a[3] = s.sourceFrame.y,
                            t.uniforms.filterArea = a
                        }
                        if (t.uniforms.filterClamp) {
                            s = s || this.filterData.stack[this.filterData.index];
                            var o = t.uniforms.filterClamp;
                            o[0] = 0,
                            o[1] = 0,
                            o[2] = (s.sourceFrame.width - 1) / s.renderTarget.size.width,
                            o[3] = (s.sourceFrame.height - 1) / s.renderTarget.size.height,
                            t.uniforms.filterClamp = o
                        }
                        for (var h in i) {
                            var u = i[h].type;
                            if ("sampler2d" === u && 0 !== n[h]) {
                                if (n[h].baseTexture)
                                    t.uniforms[h] = this.renderer.bindTexture(n[h].baseTexture, r);
                                else {
                                    t.uniforms[h] = r;
                                    var l = this.renderer.gl;
                                    this.renderer.boundTextures[r] = this.renderer.emptyTextures[r],
                                    l.activeTexture(l.TEXTURE0 + r),
                                    n[h].texture.bind()
                                }
                                r++
                            } else if ("mat3" === u)
                                void 0 !== n[h].a ? t.uniforms[h] = n[h].toArray(!0) : t.uniforms[h] = n[h];
                            else if ("vec2" === u)
                                if (void 0 !== n[h].x) {
                                    var c = t.uniforms[h] || new Float32Array(2);
                                    c[0] = n[h].x,
                                    c[1] = n[h].y,
                                    t.uniforms[h] = c
                                } else
                                    t.uniforms[h] = n[h];
                            else
                                "float" === u ? t.uniforms.data[h].value !== i[h] && (t.uniforms[h] = n[h]) : t.uniforms[h] = n[h]
                        }
                    }
                }, {
                    key: "getRenderTarget",
                    value: function (t, e) {
                        var i = this.filterData.stack[this.filterData.index],
                        n = this.getPotRenderTarget(this.renderer.gl, i.sourceFrame.width, i.sourceFrame.height, e || i.resolution);
                        return n.setFrame(i.destinationFrame, i.sourceFrame),
                        n
                    }
                }, {
                    key: "returnRenderTarget",
                    value: function (t) {
                        this.freePotRenderTarget(t)
                    }
                }, {
                    key: "calculateScreenSpaceMatrix",
                    value: function (t) {
                        var e = this.filterData.stack[this.filterData.index];
                        return function (t, e, i) {
                            var n = t.identity();
                            return n.translate(e.x / i.width, e.y / i.height),
                            n.scale(i.width, i.height),
                            n
                        }
                        (t, e.sourceFrame, e.renderTarget.size)
                    }
                }, {
                    key: "calculateNormalizedScreenSpaceMatrix",
                    value: function (t) {
                        var e = this.filterData.stack[this.filterData.index];
                        return function (t, e, i) {
                            var n = t.identity();
                            n.translate(e.x / i.width, e.y / i.height);
                            var r = i.width / e.width,
                            s = i.height / e.height;
                            return n.scale(r, s),
                            n
                        }
                        (t, e.sourceFrame, e.renderTarget.size, e.destinationFrame)
                    }
                }, {
                    key: "calculateSpriteMatrix",
                    value: function (t, e) {
                        var i = this.filterData.stack[this.filterData.index];
                        return function (t, e, i, n) {
                            var r = n._texture.orig,
                            s = t.set(i.width, 0, 0, i.height, e.x, e.y),
                            a = n.worldTransform.copy(Vt.TEMP_MATRIX);
                            return a.invert(),
                            s.prepend(a),
                            s.scale(1 / r.width, 1 / r.height),
                            s.translate(n.anchor.x, n.anchor.y),
                            s
                        }
                        (t, i.sourceFrame, i.renderTarget.size, e)
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
                        e = this.renderer,
                        i = this.managedFilters;
                        e.off("prerender", this.onPrerender, this);
                        for (var n = 0; n < i.length; n++)
                            t || i[n].glShaders[e.CONTEXT_UID].destroy(), delete i[n].glShaders[e.CONTEXT_UID];
                        this.shaderCache = {},
                        t ? this.pool = {}
                         : this.emptyPool()
                    }
                }, {
                    key: "getPotRenderTarget",
                    value: function (t, e, i, n) {
                        var r = "screen";
                        i *= n,
                        (e *= n) === this._screenWidth && i === this._screenHeight || (r = (65535 & (e = ci(e))) << 16 | 65535 & (i = ci(i))),
                        this.pool[r] || (this.pool[r] = []);
                        var s = this.pool[r].pop();
                        if (!s) {
                            var a = this.renderer.boundTextures[0];
                            t.activeTexture(t.TEXTURE0),
                            s = new fn(t, e, i, null, 1),
                            t.bindTexture(t.TEXTURE_2D, a._glTextures[this.renderer.CONTEXT_UID].texture)
                        }
                        return s.resolution = n,
                        s.defaultFrame.width = s.size.width = e / n,
                        s.defaultFrame.height = s.size.height = i / n,
                        s.filterPoolKey = r,
                        s
                    }
                }, {
                    key: "emptyPool",
                    value: function () {
                        for (var t in this.pool) {
                            var e = this.pool[t];
                            if (e)
                                for (var i = 0; i < e.length; i++)
                                    e[i].destroy(!0)
                        }
                        this.pool = {}
                    }
                }, {
                    key: "freePotRenderTarget",
                    value: function (t) {
                        this.pool[t.filterPoolKey].push(t)
                    }
                }, {
                    key: "onPrerender",
                    value: function () {
                        if (this._screenWidth !== this.renderer.view.width || this._screenHeight !== this.renderer.view.height) {
                            this._screenWidth = this.renderer.view.width,
                            this._screenHeight = this.renderer.view.height;
                            var t = this.pool.screen;
                            if (t)
                                for (var e = 0; e < t.length; e++)
                                    t[e].destroy(!0);
                            this.pool.screen = []
                        }
                    }
                }
            ]),
        e
    }
    (),
    mn = function (t) {
        function e() {
            return p(this, e),
            x(this, (e.__proto__ || Object.getPrototypeOf(e)).apply(this, arguments))
        }
        return m(e, Ci),
        g(e, [{
                    key: "start",
                    value: function () {}
                }, {
                    key: "stop",
                    value: function () {
                        this.flush()
                    }
                }, {
                    key: "flush",
                    value: function () {}
                }, {
                    key: "render",
                    value: function (t) {}
                }
            ]),
        e
    }
    (),
    xn = function () {
        function t(e) {
            p(this, t),
            this.renderer = e,
            this.gl = e.gl,
            this._managedTextures = []
        }
        return g(t, [{
                    key: "bindTexture",
                    value: function () {}
                }, {
                    key: "getTexture",
                    value: function () {}
                }, {
                    key: "updateTexture",
                    value: function (t, e) {
                        var i = this.gl,
                        n = !!t._glRenderTargets;
                        if (!t.hasLoaded)
                            return null;
                        var r = this.renderer.boundTextures;
                        if (void 0 === e) {
                            e = 0;
                            for (var s = 0; s < r.length; ++s)
                                if (r[s] === t) {
                                    e = s;
                                    break
                                }
                        }
                        r[e] = t,
                        i.activeTexture(i.TEXTURE0 + e);
                        var a = t._glTextures[this.renderer.CONTEXT_UID];
                        if (a)
                            n ? t._glRenderTargets[this.renderer.CONTEXT_UID].resize(t.width, t.height) : a.upload(t.source);
                        else {
                            if (n) {
                                var o = new fn(this.gl, t.width, t.height, t.scaleMode, t.resolution);
                                o.resize(t.width, t.height),
                                t._glRenderTargets[this.renderer.CONTEXT_UID] = o,
                                a = o.texture
                            } else (a = new Ii(this.gl, null, null, null, null)).bind(e), a.premultiplyAlpha = !0, a.upload(t.source);
                            t._glTextures[this.renderer.CONTEXT_UID] = a,
                            t.on("update", this.updateTexture, this),
                            t.on("dispose", this.destroyTexture, this),
                            this._managedTextures.push(t),
                            t.isPowerOfTwo ? (t.mipmap && a.enableMipmap(), t.wrapMode === Nt.CLAMP ? a.enableWrapClamp() : t.wrapMode === Nt.REPEAT ? a.enableWrapRepeat() : a.enableWrapMirrorRepeat()) : a.enableWrapClamp(),
                            t.scaleMode === Ft.NEAREST ? a.enableNearestScaling() : a.enableLinearScaling()
                        }
                        return a
                    }
                }, {
                    key: "destroyTexture",
                    value: function (t, e) {
                        if ((t = t.baseTexture || t).hasLoaded) {
                            var i = this.renderer.CONTEXT_UID,
                            n = t._glTextures,
                            r = t._glRenderTargets;
                            if (n[i] && (this.renderer.unbindTexture(t), n[i].destroy(), t.off("update", this.updateTexture, this), t.off("dispose", this.destroyTexture, this), delete n[i], !e)) {
                                var s = this._managedTextures.indexOf(t);
                                -1 !== s && kt(this._managedTextures, s, 1)
                            }
                            r && r[i] && (r[i].destroy(), delete r[i])
                        }
                    }
                }, {
                    key: "removeAll",
                    value: function () {
                        for (var t = 0; t < this._managedTextures.length; ++t) {
                            var e = this._managedTextures[t];
                            e._glTextures[this.renderer.CONTEXT_UID] && delete e._glTextures[this.renderer.CONTEXT_UID]
                        }
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        for (var t = 0; t < this._managedTextures.length; ++t) {
                            var e = this._managedTextures[t];
                            this.destroyTexture(e, !0),
                            e.off("update", this.updateTexture, this),
                            e.off("dispose", this.destroyTexture, this)
                        }
                        this._managedTextures = null
                    }
                }
            ]),
        t
    }
    (),
    Tn = function () {
        function t(e) {
            p(this, t),
            this.renderer = e,
            this.count = 0,
            this.checkCount = 0,
            this.maxIdle = Ze.GC_MAX_IDLE,
            this.checkCountMax = Ze.GC_MAX_CHECK_COUNT,
            this.mode = Ze.GC_MODE
        }
        return g(t, [{
                    key: "update",
                    value: function () {
                        this.count++,
                        this.mode !== Ut.MANUAL && (this.checkCount++, this.checkCount > this.checkCountMax && (this.checkCount = 0, this.run()))
                    }
                }, {
                    key: "run",
                    value: function () {
                        for (var t = this.renderer.textureManager, e = t._managedTextures, i = !1, n = 0; n < e.length; n++) {
                            var r = e[n];
                            !r._glRenderTargets && this.count - r.touched > this.maxIdle && (t.destroyTexture(r, !0), e[n] = null, i = !0)
                        }
                        if (i) {
                            for (var s = 0, a = 0; a < e.length; a++)
                                null !== e[a] && (e[s++] = e[a]);
                            e.length = s
                        }
                    }
                }, {
                    key: "unload",
                    value: function (t) {
                        var e = this.renderer.textureManager;
                        t._texture && t._texture._glRenderTargets && e.destroyTexture(t._texture, !0);
                        for (var i = t.children.length - 1; i >= 0; i--)
                            this.unload(t.children[i])
                    }
                }
            ]),
        t
    }
    ();
    var wn = function () {
        function t(e) {
            p(this, t),
            this.activeState = new Uint8Array(16),
            this.defaultState = new Uint8Array(16),
            this.defaultState[0] = 1,
            this.stackIndex = 0,
            this.stack = [],
            this.gl = e,
            this.maxAttribs = e.getParameter(e.MAX_VERTEX_ATTRIBS),
            this.attribState = {
                tempAttribState: new Array(this.maxAttribs),
                attribState: new Array(this.maxAttribs)
            },
            this.blendModes = function (t) {
                var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
                return e[Dt.NORMAL] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.ADD] = [t.ONE, t.DST_ALPHA],
                e[Dt.MULTIPLY] = [t.DST_COLOR, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.SCREEN] = [t.ONE, t.ONE_MINUS_SRC_COLOR],
                e[Dt.OVERLAY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.DARKEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.LIGHTEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.COLOR_DODGE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.COLOR_BURN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.HARD_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.SOFT_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.DIFFERENCE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.EXCLUSION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.HUE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.SATURATION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.COLOR] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.LUMINOSITY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.NORMAL_NPM] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA, t.ONE, t.ONE_MINUS_SRC_ALPHA],
                e[Dt.ADD_NPM] = [t.SRC_ALPHA, t.DST_ALPHA, t.ONE, t.DST_ALPHA],
                e[Dt.SCREEN_NPM] = [t.SRC_ALPHA, t.ONE_MINUS_SRC_COLOR, t.ONE, t.ONE_MINUS_SRC_COLOR],
                e
            }
            (e),
            this.nativeVaoExtension = e.getExtension("OES_vertex_array_object") || e.getExtension("MOZ_OES_vertex_array_object") || e.getExtension("WEBKIT_OES_vertex_array_object")
        }
        return g(t, [{
                    key: "push",
                    value: function () {
                        var t = this.stack[this.stackIndex];
                        t || (t = this.stack[this.stackIndex] = new Uint8Array(16)),
                        ++this.stackIndex;
                        for (var e = 0; e < this.activeState.length; e++)
                            t[e] = this.activeState[e]
                    }
                }, {
                    key: "pop",
                    value: function () {
                        var t = this.stack[--this.stackIndex];
                        this.setState(t)
                    }
                }, {
                    key: "setState",
                    value: function (t) {
                        this.setBlend(t[0]),
                        this.setDepthTest(t[1]),
                        this.setFrontFace(t[2]),
                        this.setCullFace(t[3]),
                        this.setBlendMode(t[4])
                    }
                }, {
                    key: "setBlend",
                    value: function (t) {
                        t = t ? 1 : 0,
                        this.activeState[0] !== t && (this.activeState[0] = t, this.gl[t ? "enable" : "disable"](this.gl.BLEND))
                    }
                }, {
                    key: "setBlendMode",
                    value: function (t) {
                        if (t !== this.activeState[4]) {
                            this.activeState[4] = t;
                            var e = this.blendModes[t];
                            2 === e.length ? this.gl.blendFunc(e[0], e[1]) : this.gl.blendFuncSeparate(e[0], e[1], e[2], e[3])
                        }
                    }
                }, {
                    key: "setDepthTest",
                    value: function (t) {
                        t = t ? 1 : 0,
                        this.activeState[1] !== t && (this.activeState[1] = t, this.gl[t ? "enable" : "disable"](this.gl.DEPTH_TEST))
                    }
                }, {
                    key: "setCullFace",
                    value: function (t) {
                        t = t ? 1 : 0,
                        this.activeState[3] !== t && (this.activeState[3] = t, this.gl[t ? "enable" : "disable"](this.gl.CULL_FACE))
                    }
                }, {
                    key: "setFrontFace",
                    value: function (t) {
                        t = t ? 1 : 0,
                        this.activeState[2] !== t && (this.activeState[2] = t, this.gl.frontFace(this.gl[t ? "CW" : "CCW"]))
                    }
                }, {
                    key: "resetAttributes",
                    value: function () {
                        for (var t = 0; t < this.attribState.tempAttribState.length; t++)
                            this.attribState.tempAttribState[t] = 0;
                        for (var e = 0; e < this.attribState.attribState.length; e++)
                            this.attribState.attribState[e] = 0;
                        for (var i = 1; i < this.maxAttribs; i++)
                            this.gl.disableVertexAttribArray(i)
                    }
                }, {
                    key: "resetToDefault",
                    value: function () {
                        this.nativeVaoExtension && this.nativeVaoExtension.bindVertexArrayOES(null),
                        this.resetAttributes();
                        for (var t = 0; t < this.activeState.length; ++t)
                            this.activeState[t] = 32;
                        this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1),
                        this.setState(this.defaultState)
                    }
                }
            ]),
        t
    }
    ();
    var bn = 0,
    En = function (t) {
        function e(t, i, n) {
            p(this, e);
            var r = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, "WebGL", t, i, n));
            return r.legacy = r.options.legacy,
            r.legacy && (en.VertexArrayObject.FORCE_NATIVE = !0),
            r.type = Rt.WEBGL,
            r.handleContextLost = r.handleContextLost.bind(r),
            r.handleContextRestored = r.handleContextRestored.bind(r),
            r.view.addEventListener("webglcontextlost", r.handleContextLost, !1),
            r.view.addEventListener("webglcontextrestored", r.handleContextRestored, !1),
            r._contextOptions = Object.assign({
                alpha: r.transparent,
                antialias: r.options.antialias,
                premultipliedAlpha: r.transparent && "notMultiplied" !== r.transparent,
                stencil: !0,
                preserveDrawingBuffer: r.options.preserveDrawingBuffer,
                powerPreference: r.options.powerPreference
            }, Je.extraContextAttributes || {}),
            r._backgroundColorRgba[3] = r.transparent ? 0 : 1,
            r.maskManager = new cn(r),
            r.stencilManager = new dn(r),
            r.emptyRenderer = new mn(r),
            r.currentRenderer = r.emptyRenderer,
            r.textureManager = null,
            r.filterManager = null,
            r.initPlugins(),
            r.options.context && (r.options.context.getContextAttributes().stencil || console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")),
            r.gl = r.options.context || en.createContext(r.view, r._contextOptions),
            r.CONTEXT_UID = bn++,
            r.state = new wn(r.gl),
            r.renderingToScreen = !0,
            r.boundTextures = null,
            r._activeShader = null,
            r._activeVao = null,
            r._activeRenderTarget = null,
            r._initContext(),
            r.drawModes = function (t) {
                var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
                return e[Lt.POINTS] = t.POINTS,
                e[Lt.LINES] = t.LINES,
                e[Lt.LINE_LOOP] = t.LINE_LOOP,
                e[Lt.LINE_STRIP] = t.LINE_STRIP,
                e[Lt.TRIANGLES] = t.TRIANGLES,
                e[Lt.TRIANGLE_STRIP] = t.TRIANGLE_STRIP,
                e[Lt.TRIANGLE_FAN] = t.TRIANGLE_FAN,
                e
            }
            (r.gl),
            r._nextTextureLocation = 0,
            r.setBlendMode(0),
            r
        }
        return m(e, Ti),
        g(e, [{
                    key: "_initContext",
                    value: function () {
                        var t = this.gl;
                        t.isContextLost() && t.getExtension("WEBGL_lose_context") && t.getExtension("WEBGL_lose_context").restoreContext();
                        var e = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);
                        this._activeShader = null,
                        this._activeVao = null,
                        this.boundTextures = new Array(e),
                        this.emptyTextures = new Array(e),
                        this.textureManager = new xn(this),
                        this.filterManager = new _n(this),
                        this.textureGC = new Tn(this),
                        this.state.resetToDefault(),
                        this.rootRenderTarget = new fn(t, this.width, this.height, null, this.resolution, !0),
                        this.rootRenderTarget.clearColor = this._backgroundColorRgba,
                        this.bindRenderTarget(this.rootRenderTarget);
                        var i = new en.GLTexture.fromData(t, null, 1, 1),
                        n = {
                            _glTextures: {}
                        };
                        n._glTextures[this.CONTEXT_UID] = {};
                        for (var r = 0; r < e; r++) {
                            var s = new di;
                            s._glTextures[this.CONTEXT_UID] = i,
                            this.boundTextures[r] = n,
                            this.emptyTextures[r] = s,
                            this.bindTexture(null, r)
                        }
                        this.emit("context", t),
                        this.resize(this.screen.width, this.screen.height)
                    }
                }, {
                    key: "render",
                    value: function (t, e, i, n, r) {
                        if (this.renderingToScreen = !e, this.emit("prerender"), this.gl && !this.gl.isContextLost()) {
                            if (this._nextTextureLocation = 0, e || (this._lastObjectRendered = t), !r) {
                                var s = t.parent;
                                t.parent = this._tempDisplayObjectParent,
                                t.updateTransform(),
                                t.parent = s
                            }
                            this.bindRenderTexture(e, n),
                            this.currentRenderer.start(),
                            (void 0 !== i ? i : this.clearBeforeRender) && this._activeRenderTarget.clear(),
                            t.renderWebGL(this),
                            this.currentRenderer.flush(),
                            this.textureGC.update(),
                            this.emit("postrender")
                        }
                    }
                }, {
                    key: "setObjectRenderer",
                    value: function (t) {
                        this.currentRenderer !== t && (this.currentRenderer.stop(), this.currentRenderer = t, this.currentRenderer.start())
                    }
                }, {
                    key: "flush",
                    value: function () {
                        this.setObjectRenderer(this.emptyRenderer)
                    }
                }, {
                    key: "resize",
                    value: function (t, e) {
                        Ti.prototype.resize.call(this, t, e),
                        this.rootRenderTarget.resize(t, e),
                        this._activeRenderTarget === this.rootRenderTarget && (this.rootRenderTarget.activate(), this._activeShader && (this._activeShader.uniforms.projectionMatrix = this.rootRenderTarget.projectionMatrix.toArray(!0)))
                    }
                }, {
                    key: "setBlendMode",
                    value: function (t) {
                        this.state.setBlendMode(t)
                    }
                }, {
                    key: "clear",
                    value: function (t) {
                        this._activeRenderTarget.clear(t)
                    }
                }, {
                    key: "setTransform",
                    value: function (t) {
                        this._activeRenderTarget.transform = t
                    }
                }, {
                    key: "clearRenderTexture",
                    value: function (t, e) {
                        var i = t.baseTexture._glRenderTargets[this.CONTEXT_UID];
                        return i && i.clear(e),
                        this
                    }
                }, {
                    key: "bindRenderTexture",
                    value: function (t, e) {
                        var i = void 0;
                        if (t) {
                            var n = t.baseTexture;
                            n._glRenderTargets[this.CONTEXT_UID] || this.textureManager.updateTexture(n, 0),
                            this.unbindTexture(n),
                            (i = n._glRenderTargets[this.CONTEXT_UID]).setFrame(t.frame)
                        } else
                            i = this.rootRenderTarget;
                        return i.transform = e,
                        this.bindRenderTarget(i),
                        this
                    }
                }, {
                    key: "bindRenderTarget",
                    value: function (t) {
                        return t !== this._activeRenderTarget && (this._activeRenderTarget = t, t.activate(), this._activeShader && (this._activeShader.uniforms.projectionMatrix = t.projectionMatrix.toArray(!0)), this.stencilManager.setMaskStack(t.stencilMaskStack)),
                        this
                    }
                }, {
                    key: "bindShader",
                    value: function (t, e) {
                        return this._activeShader !== t && (this._activeShader = t, t.bind(), !1 !== e && (t.uniforms.projectionMatrix = this._activeRenderTarget.projectionMatrix.toArray(!0))),
                        this
                    }
                }, {
                    key: "bindTexture",
                    value: function (t, e, i) {
                        if ((t = (t = t || this.emptyTextures[e]).baseTexture || t).touched = this.textureGC.count, i)
                            e = e || 0;
                        else {
                            for (var n = 0; n < this.boundTextures.length; n++)
                                if (this.boundTextures[n] === t)
                                    return n;
                            void 0 === e && (this._nextTextureLocation++, this._nextTextureLocation %= this.boundTextures.length, e = this.boundTextures.length - this._nextTextureLocation - 1)
                        }
                        var r = this.gl,
                        s = t._glTextures[this.CONTEXT_UID];
                        return s ? (this.boundTextures[e] = t, r.activeTexture(r.TEXTURE0 + e), r.bindTexture(r.TEXTURE_2D, s.texture)) : this.textureManager.updateTexture(t, e),
                        e
                    }
                }, {
                    key: "unbindTexture",
                    value: function (t) {
                        var e = this.gl;
                        t = t.baseTexture || t;
                        for (var i = 0; i < this.boundTextures.length; i++)
                            this.boundTextures[i] === t && (this.boundTextures[i] = this.emptyTextures[i], e.activeTexture(e.TEXTURE0 + i), e.bindTexture(e.TEXTURE_2D, this.emptyTextures[i]._glTextures[this.CONTEXT_UID].texture));
                        return this
                    }
                }, {
                    key: "createVao",
                    value: function () {
                        return new en.VertexArrayObject(this.gl, this.state.attribState)
                    }
                }, {
                    key: "bindVao",
                    value: function (t) {
                        return this._activeVao === t ? this : (t ? t.bind() : this._activeVao && this._activeVao.unbind(), this._activeVao = t, this)
                    }
                }, {
                    key: "reset",
                    value: function () {
                        this.setObjectRenderer(this.emptyRenderer),
                        this.bindVao(null),
                        this._activeShader = null,
                        this._activeRenderTarget = this.rootRenderTarget;
                        for (var t = 0; t < this.boundTextures.length; t++)
                            this.boundTextures[t] = this.emptyTextures[t];
                        return this.rootRenderTarget.activate(),
                        this.state.resetToDefault(),
                        this
                    }
                }, {
                    key: "handleContextLost",
                    value: function (t) {
                        t.preventDefault()
                    }
                }, {
                    key: "handleContextRestored",
                    value: function () {
                        this.textureManager.removeAll(),
                        this.filterManager.destroy(!0),
                        this._initContext()
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        this.destroyPlugins(),
                        this.view.removeEventListener("webglcontextlost", this.handleContextLost),
                        this.view.removeEventListener("webglcontextrestored", this.handleContextRestored),
                        this.textureManager.destroy(),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, t),
                        this.uid = 0,
                        this.maskManager.destroy(),
                        this.stencilManager.destroy(),
                        this.filterManager.destroy(),
                        this.maskManager = null,
                        this.filterManager = null,
                        this.textureManager = null,
                        this.currentRenderer = null,
                        this.handleContextLost = null,
                        this.handleContextRestored = null,
                        this._contextOptions = null,
                        this.gl.useProgram(null),
                        this.gl.getExtension("WEBGL_lose_context") && this.gl.getExtension("WEBGL_lose_context").loseContext(),
                        this.gl = null
                    }
                }
            ]),
        e
    }
    ();
    ae.mixin(En);
    var kn = new Yt,
    Sn = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return i._anchor = new Ht(i._onAnchorUpdate, i, t ? t.defaultAnchor.x : 0, t ? t.defaultAnchor.y : 0),
            i._texture = null,
            i._width = 0,
            i._height = 0,
            i._tint = null,
            i._tintRGB = null,
            i.tint = 16777215,
            i.blendMode = Dt.NORMAL,
            i.shader = null,
            i.cachedTint = 16777215,
            i.texture = t || yi.EMPTY,
            i.vertexData = new Float32Array(8),
            i.vertexTrimmedData = null,
            i._transformID = -1,
            i._textureID = -1,
            i._transformTrimmedID = -1,
            i._textureTrimmedID = -1,
            i.pluginName = "sprite",
            i
        }
        return m(e, ui),
        g(e, [{
                    key: "_onTextureUpdate",
                    value: function () {
                        this._textureID = -1,
                        this._textureTrimmedID = -1,
                        this.cachedTint = 16777215,
                        this._width && (this.scale.x = Math.sign(this.scale.x) * this._width / this._texture.orig.width),
                        this._height && (this.scale.y = Math.sign(this.scale.y) * this._height / this._texture.orig.height)
                    }
                }, {
                    key: "_onAnchorUpdate",
                    value: function () {
                        this._transformID = -1,
                        this._transformTrimmedID = -1
                    }
                }, {
                    key: "calculateVertices",
                    value: function () {
                        if (this._transformID !== this.transform._worldID || this._textureID !== this._texture._updateID) {
                            this._transformID = this.transform._worldID,
                            this._textureID = this._texture._updateID;
                            var t = this._texture,
                            e = this.transform.worldTransform,
                            i = e.a,
                            n = e.b,
                            r = e.c,
                            s = e.d,
                            a = e.tx,
                            o = e.ty,
                            h = this.vertexData,
                            u = t.trim,
                            l = t.orig,
                            c = this._anchor,
                            d = 0,
                            f = 0,
                            v = 0,
                            p = 0;
                            u ? (d = (f = u.x - c._x * l.width) + u.width, v = (p = u.y - c._y * l.height) + u.height) : (d = (f = -c._x * l.width) + l.width, v = (p = -c._y * l.height) + l.height),
                            h[0] = i * f + r * p + a,
                            h[1] = s * p + n * f + o,
                            h[2] = i * d + r * p + a,
                            h[3] = s * p + n * d + o,
                            h[4] = i * d + r * v + a,
                            h[5] = s * v + n * d + o,
                            h[6] = i * f + r * v + a,
                            h[7] = s * v + n * f + o
                        }
                    }
                }, {
                    key: "calculateTrimmedVertices",
                    value: function () {
                        if (this.vertexTrimmedData) {
                            if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID)
                                return
                        } else
                            this.vertexTrimmedData = new Float32Array(8);
                        this._transformTrimmedID = this.transform._worldID,
                        this._textureTrimmedID = this._texture._updateID;
                        var t = this._texture,
                        e = this.vertexTrimmedData,
                        i = t.orig,
                        n = this._anchor,
                        r = this.transform.worldTransform,
                        s = r.a,
                        a = r.b,
                        o = r.c,
                        h = r.d,
                        u = r.tx,
                        l = r.ty,
                        c = -n._x * i.width,
                        d = c + i.width,
                        f = -n._y * i.height,
                        v = f + i.height;
                        e[0] = s * c + o * f + u,
                        e[1] = h * f + a * c + l,
                        e[2] = s * d + o * f + u,
                        e[3] = h * f + a * d + l,
                        e[4] = s * d + o * v + u,
                        e[5] = h * v + a * d + l,
                        e[6] = s * c + o * v + u,
                        e[7] = h * v + a * c + l
                    }
                }, {
                    key: "_renderWebGL",
                    value: function (t) {
                        this.calculateVertices(),
                        t.setObjectRenderer(t.plugins[this.pluginName]),
                        t.plugins[this.pluginName].render(this)
                    }
                }, {
                    key: "_renderCanvas",
                    value: function (t) {
                        t.plugins[this.pluginName].render(this)
                    }
                }, {
                    key: "_calculateBounds",
                    value: function () {
                        var t = this._texture.trim,
                        e = this._texture.orig;
                        !t || t.width === e.width && t.height === e.height ? (this.calculateVertices(), this._bounds.addQuad(this.vertexData)) : (this.calculateTrimmedVertices(), this._bounds.addQuad(this.vertexTrimmedData))
                    }
                }, {
                    key: "getLocalBounds",
                    value: function (t) {
                        return 0 === this.children.length ? (this._bounds.minX = this._texture.orig.width * -this._anchor._x, this._bounds.minY = this._texture.orig.height * -this._anchor._y, this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x), this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y), t || (this._localBoundsRect || (this._localBoundsRect = new ee), t = this._localBoundsRect), this._bounds.getRectangle(t)) : _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "getLocalBounds", this).call(this, t)
                    }
                }, {
                    key: "containsPoint",
                    value: function (t) {
                        this.worldTransform.applyInverse(t, kn);
                        var e = this._texture.orig.width,
                        i = this._texture.orig.height,
                        n = -e * this.anchor.x,
                        r = 0;
                        return kn.x >= n && kn.x < n + e && (r = -i * this.anchor.y, kn.y >= r && kn.y < r + i)
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        if (_(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, t), this._texture && this._texture.off("update", this._onTextureUpdate, this), this._anchor = null, ("boolean" == typeof t ? t : t && t.texture) && this._texture) {
                            var i = "boolean" == typeof t ? t : t && t.baseTexture;
                            this._texture.destroy(!!i)
                        }
                        this._texture = null,
                        this.shader = null
                    }
                }, {
                    key: "setAnchor",
                    value: function (t, e) {
                        this.anchor.set(t, void 0 === e ? t : e)
                    }
                }, {
                    key: "getAnchor",
                    value: function () {
                        return this.anchor
                    }
                }, {
                    key: "width",
                    get: function () {
                        return Math.abs(this.scale.x) * this._texture.orig.width
                    },
                    set: function (t) {
                        var e = Math.sign(this.scale.x) || 1;
                        this.scale.x = e * t / this._texture.orig.width,
                        this._width = t
                    }
                }, {
                    key: "height",
                    get: function () {
                        return Math.abs(this.scale.y) * this._texture.orig.height
                    },
                    set: function (t) {
                        var e = Math.sign(this.scale.y) || 1;
                        this.scale.y = e * t / this._texture.orig.height,
                        this._height = t
                    }
                }, {
                    key: "anchor",
                    get: function () {
                        return this._anchor
                    },
                    set: function (t) {
                        this._anchor.copy(t)
                    }
                }, {
                    key: "tint",
                    get: function () {
                        return this._tint
                    },
                    set: function (t) {
                        this._tint = t,
                        this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16)
                    }
                }, {
                    key: "texture",
                    get: function () {
                        return this._texture
                    },
                    set: function (t) {
                        this._texture !== t && (this._texture = t || yi.EMPTY, this.cachedTint = 16777215, this._textureID = -1, this._textureTrimmedID = -1, t && (t.baseTexture.hasLoaded ? this._onTextureUpdate() : t.once("update", this._onTextureUpdate, this)))
                    }
                }
            ], [{
                    key: "from",
                    value: function (t) {
                        return new e(yi.from(t))
                    }
                }, {
                    key: "fromFrame",
                    value: function (t) {
                        var i = Ge[t];
                        if (!i)
                            throw new Error('The frameId "' + t + '" does not exist in the texture cache');
                        return new e(i)
                    }
                }, {
                    key: "fromImage",
                    value: function (t, i, n) {
                        return new e(yi.fromImage(t, i, n))
                    }
                }
            ]),
        e
    }
    (),
    Cn = function (t) {
        function e(t, i) {
            p(this, e);
            var n = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t[0]instanceof yi ? t[0] : t[0].texture));
            return n._textures = null,
            n._durations = null,
            n.textures = t,
            n._autoUpdate = !1 !== i,
            n.animationSpeed = 1,
            n.loop = !0,
            n.onComplete = null,
            n.onFrameChange = null,
            n.onLoop = null,
            n._currentTime = 0,
            n.playing = !1,
            n
        }
        return m(e, Sn),
        g(e, [{
                    key: "stop",
                    value: function () {
                        this.playing && (this.playing = !1, this._autoUpdate && ii.remove(this._update, this))
                    }
                }, {
                    key: "play",
                    value: function () {
                        this.playing || (this.playing = !0, this._autoUpdate && ii.add(this._update, this, Gt.HIGH))
                    }
                }, {
                    key: "gotoAndStop",
                    value: function (t) {
                        this.stop();
                        var e = this.currentFrame;
                        this._currentTime = t,
                        e !== this.currentFrame && this.updateTexture()
                    }
                }, {
                    key: "gotoAndPlay",
                    value: function (t) {
                        var e = this.currentFrame;
                        this._currentTime = t,
                        e !== this.currentFrame && this.updateTexture(),
                        this.play()
                    }
                }, {
                    key: "_update",
                    value: function (t) {
                        var e = this.animationSpeed * t,
                        i = this.currentFrame;
                        if (null !== this._durations) {
                            var n = this._currentTime % 1 * this._durations[this.currentFrame];
                            for (n += e / 60 * 1e3; n < 0; )
                                this._currentTime--, n += this._durations[this.currentFrame];
                            var r = Math.sign(this.animationSpeed * t);
                            for (this._currentTime = Math.floor(this._currentTime); n >= this._durations[this.currentFrame]; )
                                n -= this._durations[this.currentFrame] * r, this._currentTime += r;
                            this._currentTime += n / this._durations[this.currentFrame]
                        } else
                            this._currentTime += e;
                        this._currentTime < 0 && !this.loop ? (this.gotoAndStop(0), this.onComplete && this.onComplete()) : this._currentTime >= this._textures.length && !this.loop ? (this.gotoAndStop(this._textures.length - 1), this.onComplete && this.onComplete()) : i !== this.currentFrame && (this.loop && this.onLoop && (this.animationSpeed > 0 && this.currentFrame < i ? this.onLoop() : this.animationSpeed < 0 && this.currentFrame > i && this.onLoop()), this.updateTexture())
                    }
                }, {
                    key: "updateTexture",
                    value: function () {
                        this._texture = this._textures[this.currentFrame],
                        this._textureID = -1,
                        this.cachedTint = 16777215,
                        this.onFrameChange && this.onFrameChange(this.currentFrame)
                    }
                }, {
                    key: "reverse",
                    value: function () {
                        this._currentTime = this._textures.length - this.currentFrame - 1,
                        this._textures.reverse()
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        this.stop(),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, t)
                    }
                }, {
                    key: "totalFrames",
                    get: function () {
                        return this._textures.length
                    }
                }, {
                    key: "textures",
                    get: function () {
                        return this._textures
                    },
                    set: function (t) {
                        if (t[0]instanceof yi)
                            this._textures = t, this._durations = null;
                        else {
                            this._textures = [],
                            this._durations = [];
                            for (var e = 0; e < t.length; e++)
                                this._textures.push(t[e].texture), this._durations.push(t[e].time)
                        }
                        this.gotoAndPlay(0),
                        this.updateTexture()
                    }
                }, {
                    key: "currentFrame",
                    get: function () {
                        var t = Math.floor(this._currentTime) % this._textures.length;
                        return t < 0 && (t += this._textures.length),
                        t
                    }
                }
            ], [{
                    key: "fromFrames",
                    value: function (t) {
                        for (var i = [], n = 0; n < t.length; ++n)
                            i.push(yi.fromFrame(t[n]));
                        return new e(i)
                    }
                }, {
                    key: "fromImages",
                    value: function (t) {
                        for (var i = [], n = 0; n < t.length; ++n)
                            i.push(yi.fromImage(t[n]));
                        return new e(i)
                    }
                }
            ]),
        e
    }
    (),
    On = {
        getTintedTexture: function (t, e) {
            var i = t._texture,
            n = "#" + ("00000" + (0 | (e = On.roundColor(e))).toString(16)).substr(-6);
            i.tintCache = i.tintCache || {};
            var r = i.tintCache[n],
            s = void 0;
            if (r) {
                if (r.tintId === i._updateID)
                    return i.tintCache[n];
                s = i.tintCache[n]
            } else
                s = On.canvas || document.createElement("canvas");
            if (On.tintMethod(i, e, s), s.tintId = i._updateID, On.convertTintToImage) {
                var a = new Image;
                a.src = s.toDataURL(),
                i.tintCache[n] = a
            } else
                i.tintCache[n] = s, On.canvas = null;
            return s
        },
        tintWithMultiply: function (t, e, i) {
            var n = i.getContext("2d"),
            r = t._frame.clone(),
            s = t.baseTexture.resolution;
            r.x *= s,
            r.y *= s,
            r.width *= s,
            r.height *= s,
            i.width = Math.ceil(r.width),
            i.height = Math.ceil(r.height),
            n.save(),
            n.fillStyle = "#" + ("00000" + (0 | e).toString(16)).substr(-6),
            n.fillRect(0, 0, r.width, r.height),
            n.globalCompositeOperation = "multiply",
            n.drawImage(t.baseTexture.source, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height),
            n.globalCompositeOperation = "destination-atop",
            n.drawImage(t.baseTexture.source, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height),
            n.restore()
        },
        tintWithOverlay: function (t, e, i) {
            var n = i.getContext("2d"),
            r = t._frame.clone(),
            s = t.baseTexture.resolution;
            r.x *= s,
            r.y *= s,
            r.width *= s,
            r.height *= s,
            i.width = Math.ceil(r.width),
            i.height = Math.ceil(r.height),
            n.save(),
            n.globalCompositeOperation = "copy",
            n.fillStyle = "#" + ("00000" + (0 | e).toString(16)).substr(-6),
            n.fillRect(0, 0, r.width, r.height),
            n.globalCompositeOperation = "destination-atop",
            n.drawImage(t.baseTexture.source, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height),
            n.restore()
        },
        tintWithPerPixel: function (t, e, i) {
            var n = i.getContext("2d"),
            r = t._frame.clone(),
            s = t.baseTexture.resolution;
            r.x *= s,
            r.y *= s,
            r.width *= s,
            r.height *= s,
            i.width = Math.ceil(r.width),
            i.height = Math.ceil(r.height),
            n.save(),
            n.globalCompositeOperation = "copy",
            n.drawImage(t.baseTexture.source, r.x, r.y, r.width, r.height, 0, 0, r.width, r.height),
            n.restore();
            for (var a = pt(e), o = a[0], h = a[1], u = a[2], l = n.getImageData(0, 0, r.width, r.height), c = l.data, d = 0; d < c.length; d += 4)
                c[d + 0] *= o, c[d + 1] *= h, c[d + 2] *= u;
            n.putImageData(l, 0, 0)
        },
        roundColor: function (t) {
            var e = On.cacheStepsPerColorChannel,
            i = pt(t);
            return i[0] = Math.min(255, i[0] / e * e),
            i[1] = Math.min(255, i[1] / e * e),
            i[2] = Math.min(255, i[2] / e * e),
            yt(i)
        },
        cacheStepsPerColorChannel: 8,
        convertTintToImage: !1,
        canUseMultiply: ki(),
        tintMethod: 0
    };
    On.tintMethod = On.canUseMultiply ? On.tintWithMultiply : On.tintWithPerPixel;
    var Pn = new Vt,
    Mn = function () {
        function t(e) {
            p(this, t),
            this.renderer = e
        }
        return g(t, [{
                    key: "render",
                    value: function (t) {
                        var e = t._texture,
                        i = this.renderer,
                        n = e._frame.width,
                        r = e._frame.height,
                        s = t.transform.worldTransform,
                        a = 0,
                        o = 0;
                        if (!(e.orig.width <= 0 || e.orig.height <= 0) && e.baseTexture.source && (i.setBlendMode(t.blendMode), e.valid)) {
                            i.context.globalAlpha = t.worldAlpha;
                            var h = e.baseTexture.scaleMode === Ft.LINEAR;
                            i.smoothProperty && i.context[i.smoothProperty] !== h && (i.context[i.smoothProperty] = h),
                            e.trim ? (a = e.trim.width / 2 + e.trim.x - t.anchor.x * e.orig.width, o = e.trim.height / 2 + e.trim.y - t.anchor.y * e.orig.height) : (a = (.5 - t.anchor.x) * e.orig.width, o = (.5 - t.anchor.y) * e.orig.height),
                            e.rotate && (s.copy(Pn), s = Pn, te.matrixAppendRotationInv(s, e.rotate, a, o), a = 0, o = 0),
                            a -= n / 2,
                            o -= r / 2,
                            i.roundPixels ? (i.context.setTransform(s.a, s.b, s.c, s.d, s.tx * i.resolution | 0, s.ty * i.resolution | 0), a |= 0, o |= 0) : i.context.setTransform(s.a, s.b, s.c, s.d, s.tx * i.resolution, s.ty * i.resolution);
                            var u = e.baseTexture.resolution;
                            16777215 !== t.tint ? (t.cachedTint === t.tint && t.tintedTexture.tintId === t._texture._updateID || (t.cachedTint = t.tint, t.tintedTexture = On.getTintedTexture(t, t.tint)), i.context.drawImage(t.tintedTexture, 0, 0, n * u, r * u, a * i.resolution, o * i.resolution, n * i.resolution, r * i.resolution)) : i.context.drawImage(e.baseTexture.source, e._frame.x * u, e._frame.y * u, n * u, r * u, a * i.resolution, o * i.resolution, n * i.resolution, r * i.resolution)
                        }
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.renderer = null
                    }
                }
            ]),
        t
    }
    ();
    Si.registerPlugin("sprite", Mn);
    var An = "\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n  vec4 color;\n  float textureId = floor(vTextureId+0.5);\n  %forloop%\n  gl_FragColor = color * vColor;\n}\n",
    In = "\nprecision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n  vTextureCoord = aTextureCoord;\n  vTextureId = aTextureId;\n  vColor = aColor;\n}\n";
    var Rn = "\nprecision mediump float;\nvoid main(void){\n  float test = 0.1;\n  %forloop%\n  gl_FragColor = vec4(0.0);\n}\n";
    function Dn(t) {
        for (var e = "", i = 0; i < t; ++i)
            i > 0 && (e += "\nelse "), i < t - 1 && (e += "if(test == " + i + ".0){}");
        return e
    }
    var Ln = function () {
        function t(e) {
            p(this, t),
            this.vertices = new ArrayBuffer(e),
            this.float32View = new Float32Array(this.vertices),
            this.uint32View = new Uint32Array(this.vertices)
        }
        return g(t, [{
                    key: "destroy",
                    value: function () {
                        this.vertices = null,
                        this.positions = null,
                        this.uvs = null,
                        this.colors = null
                    }
                }
            ]),
        t
    }
    (),
    Fn = 0,
    Nn = 0,
    Un = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
            i.vertSize = 5,
            i.vertByteSize = 4 * i.vertSize,
            i.size = Ze.SPRITE_BATCH_SIZE,
            i.buffers = [];
            for (var n = 1; n <= ci(i.size); n *= 2)
                i.buffers.push(new Ln(4 * n * i.vertByteSize));
            i.indices = vn(i.size),
            i.shader = null,
            i.currentIndex = 0,
            i.groups = [];
            for (var r = 0; r < i.size; r++)
                i.groups[r] = {
                    textures: [],
                    textureCount: 0,
                    ids: [],
                    size: 0,
                    start: 0,
                    blend: 0
                };
            return i.sprites = [],
            i.vertexBuffers = [],
            i.vaos = [],
            i.vaoMax = 2,
            i.vertexCount = 0,
            i.renderer.on("prerender", i.onPrerender, i),
            i
        }
        return m(e, mn),
        g(e, [{
                    key: "onContextChange",
                    value: function () {
                        var t = this.renderer.gl;
                        this.renderer.legacy ? this.MAX_TEXTURES = 1 : (this.MAX_TEXTURES = Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS), Ze.SPRITE_MAX_TEXTURES), this.MAX_TEXTURES = function (t, e) {
                                var i = !e;
                                if (i) {
                                    var n = document.createElement("canvas");
                                    n.width = 1,
                                    n.height = 1,
                                    e = en.createContext(n)
                                }
                                for (var r = e.createShader(e.FRAGMENT_SHADER); ; ) {
                                    var s = Rn.replace(/%forloop%/gi, Dn(t));
                                    if (e.shaderSource(r, s), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS))
                                        break;
                                    t = t / 2 | 0
                                }
                                return i && e.getExtension("WEBGL_lose_context") && e.getExtension("WEBGL_lose_context").loseContext(),
                                t
                            }
                                (this.MAX_TEXTURES, t)),
                        this.shader = function (t, e) {
                            var i = In,
                            n = An;
                            n = (n = n.replace(/%count%/gi, e)).replace(/%forloop%/gi, function (t) {
                                var e = "";
                                e += "\n",
                                e += "\n";
                                for (var i = 0; i < t; i++)
                                    i > 0 && (e += "\nelse "), i < t - 1 && (e += "if(textureId == " + i + ".0)"), e += "\n{", e += "\n\tcolor = texture2D(uSamplers[" + i + "], vTextureCoord);", e += "\n}";
                                return e += "\n",
                                e += "\n"
                            }
                                (e));
                            for (var r = new gn(t, i, n), s = [], a = 0; a < e; a++)
                                s[a] = a;
                            return r.bind(),
                            r.uniforms.uSamplers = s,
                            r
                        }
                        (t, this.MAX_TEXTURES),
                        this.indexBuffer = en.GLBuffer.createIndexBuffer(t, this.indices, t.STATIC_DRAW),
                        this.renderer.bindVao(null);
                        for (var e = this.shader.attributes, i = 0; i < this.vaoMax; i++) {
                            var n = this.vertexBuffers[i] = en.GLBuffer.createVertexBuffer(t, null, t.STREAM_DRAW),
                            r = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(n, e.aVertexPosition, t.FLOAT, !1, this.vertByteSize, 0).addAttribute(n, e.aTextureCoord, t.UNSIGNED_SHORT, !0, this.vertByteSize, 8).addAttribute(n, e.aColor, t.UNSIGNED_BYTE, !0, this.vertByteSize, 12);
                            e.aTextureId && r.addAttribute(n, e.aTextureId, t.FLOAT, !1, this.vertByteSize, 16),
                            this.vaos[i] = r
                        }
                        this.vao = this.vaos[0],
                        this.currentBlendMode = 99999,
                        this.boundTextures = new Array(this.MAX_TEXTURES)
                    }
                }, {
                    key: "onPrerender",
                    value: function () {
                        this.vertexCount = 0
                    }
                }, {
                    key: "render",
                    value: function (t) {
                        this.currentIndex >= this.size && this.flush(),
                        t._texture._uvs && (this.sprites[this.currentIndex++] = t)
                    }
                }, {
                    key: "flush",
                    value: function () {
                        if (0 !== this.currentIndex) {
                            var t,
                            e,
                            i,
                            n = this.renderer.gl,
                            r = this.MAX_TEXTURES,
                            s = ci(this.currentIndex),
                            a = (e = void 0, i = void 0, e = ((t = s) > 65535) << 4, e |= i = ((t >>>= e) > 255) << 3, e |= i = ((t >>>= i) > 15) << 2, (e |= i = ((t >>>= i) > 3) << 1) | (t >>>= i) >> 1),
                            o = this.buffers[a],
                            h = this.sprites,
                            u = this.groups,
                            l = o.float32View,
                            c = o.uint32View,
                            d = this.boundTextures,
                            f = this.renderer.boundTextures,
                            v = this.renderer.textureGC.count,
                            p = 0,
                            g = void 0,
                            y = void 0,
                            _ = 1,
                            m = 0,
                            x = u[0],
                            T = void 0,
                            w = void 0,
                            b = He[h[0]._texture.baseTexture.premultipliedAlpha ? 1 : 0][h[0].blendMode];
                            x.textureCount = 0,
                            x.start = 0,
                            x.blend = b,
                            Fn++;
                            var E = void 0;
                            for (E = 0; E < r; ++E) {
                                var k = f[E];
                                k._enabled !== Fn ? (d[E] = k, k._virtalBoundId = E, k._enabled = Fn) : d[E] = this.renderer.emptyTextures[E]
                            }
                            for (Fn++, E = 0; E < this.currentIndex; ++E) {
                                var S = h[E];
                                h[E] = null,
                                g = S._texture.baseTexture;
                                var C = He[Number(g.premultipliedAlpha)][S.blendMode];
                                if (b !== C && (b = C, y = null, m = r, Fn++), y !== g && (y = g, g._enabled !== Fn)) {
                                    if (m === r && (Fn++, x.size = E - x.start, m = 0, (x = u[_++]).blend = b, x.textureCount = 0, x.start = E), g.touched = v, -1 === g._virtalBoundId)
                                        for (var O = 0; O < r; ++O) {
                                            var P = (O + Nn) % r,
                                            M = d[P];
                                            if (M._enabled !== Fn) {
                                                Nn++,
                                                M._virtalBoundId = -1,
                                                g._virtalBoundId = P,
                                                d[P] = g;
                                                break
                                            }
                                        }
                                    g._enabled = Fn,
                                    x.textureCount++,
                                    x.ids[m] = g._virtalBoundId,
                                    x.textures[m++] = g
                                }
                                if (T = S.vertexData, w = S._texture._uvs.uvsUint32, this.renderer.roundPixels) {
                                    var A = this.renderer.resolution;
                                    l[p] = (T[0] * A | 0) / A,
                                    l[p + 1] = (T[1] * A | 0) / A,
                                    l[p + 5] = (T[2] * A | 0) / A,
                                    l[p + 6] = (T[3] * A | 0) / A,
                                    l[p + 10] = (T[4] * A | 0) / A,
                                    l[p + 11] = (T[5] * A | 0) / A,
                                    l[p + 15] = (T[6] * A | 0) / A,
                                    l[p + 16] = (T[7] * A | 0) / A
                                } else
                                    l[p] = T[0], l[p + 1] = T[1], l[p + 5] = T[2], l[p + 6] = T[3], l[p + 10] = T[4], l[p + 11] = T[5], l[p + 15] = T[6], l[p + 16] = T[7];
                                c[p + 2] = w[0],
                                c[p + 7] = w[1],
                                c[p + 12] = w[2],
                                c[p + 17] = w[3];
                                var I = Math.min(S.worldAlpha, 1),
                                R = I < 1 && g.premultipliedAlpha ? Ve(S._tintRGB, I) : S._tintRGB + (255 * I << 24);
                                c[p + 3] = c[p + 8] = c[p + 13] = c[p + 18] = R,
                                l[p + 4] = l[p + 9] = l[p + 14] = l[p + 19] = g._virtalBoundId,
                                p += 20
                            }
                            if (x.size = E - x.start, Ze.CAN_UPLOAD_SAME_BUFFER)
                                this.vertexBuffers[this.vertexCount].upload(o.vertices, 0, !0);
                            else {
                                if (this.vaoMax <= this.vertexCount) {
                                    this.vaoMax++;
                                    var D = this.shader.attributes,
                                    L = this.vertexBuffers[this.vertexCount] = en.GLBuffer.createVertexBuffer(n, null, n.STREAM_DRAW),
                                    F = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(L, D.aVertexPosition, n.FLOAT, !1, this.vertByteSize, 0).addAttribute(L, D.aTextureCoord, n.UNSIGNED_SHORT, !0, this.vertByteSize, 8).addAttribute(L, D.aColor, n.UNSIGNED_BYTE, !0, this.vertByteSize, 12);
                                    D.aTextureId && F.addAttribute(L, D.aTextureId, n.FLOAT, !1, this.vertByteSize, 16),
                                    this.vaos[this.vertexCount] = F
                                }
                                this.renderer.bindVao(this.vaos[this.vertexCount]),
                                this.vertexBuffers[this.vertexCount].upload(o.vertices, 0, !1),
                                this.vertexCount++
                            }
                            for (E = 0; E < r; ++E)
                                f[E]._virtalBoundId = -1;
                            for (E = 0; E < _; ++E) {
                                for (var N = u[E], U = N.textureCount, B = 0; B < U; B++)
                                    y = N.textures[B], f[N.ids[B]] !== y && this.renderer.bindTexture(y, N.ids[B], !0), y._virtalBoundId = -1;
                                this.renderer.state.setBlendMode(N.blend),
                                n.drawElements(n.TRIANGLES, 6 * N.size, n.UNSIGNED_SHORT, 6 * N.start * 2)
                            }
                            this.currentIndex = 0
                        }
                    }
                }, {
                    key: "start",
                    value: function () {
                        this.renderer.bindShader(this.shader),
                        Ze.CAN_UPLOAD_SAME_BUFFER && (this.renderer.bindVao(this.vaos[this.vertexCount]), this.vertexBuffers[this.vertexCount].bind())
                    }
                }, {
                    key: "stop",
                    value: function () {
                        this.flush()
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        for (var t = 0; t < this.vaoMax; t++)
                            this.vertexBuffers[t] && this.vertexBuffers[t].destroy(), this.vaos[t] && this.vaos[t].destroy();
                        this.indexBuffer && this.indexBuffer.destroy(),
                        this.renderer.off("prerender", this.onPrerender, this),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this),
                        this.shader && (this.shader.destroy(), this.shader = null),
                        this.vertexBuffers = null,
                        this.vaos = null,
                        this.indexBuffer = null,
                        this.indices = null,
                        this.sprites = null;
                        for (var i = 0; i < this.buffers.length; ++i)
                            this.buffers[i].destroy()
                    }
                }
            ]),
        e
    }
    ();
    En.registerPlugin("sprite", Un);
    var Bn = {
        align: "left",
        breakWords: !1,
        dropShadow: !1,
        dropShadowAlpha: 1,
        dropShadowAngle: Math.PI / 6,
        dropShadowBlur: 0,
        dropShadowColor: "black",
        dropShadowDistance: 5,
        fill: "black",
        fillGradientType: jt.LINEAR_VERTICAL,
        fillGradientStops: [],
        fontFamily: "Arial",
        fontSize: 26,
        fontStyle: "normal",
        fontVariant: "normal",
        fontWeight: "normal",
        letterSpacing: 0,
        lineHeight: 0,
        lineJoin: "miter",
        miterLimit: 10,
        padding: 0,
        stroke: "black",
        strokeThickness: 0,
        textBaseline: "alphabetic",
        trim: !1,
        whiteSpace: "pre",
        wordWrap: !1,
        wordWrapWidth: 100,
        leading: 0
    },
    Xn = ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui"],
    jn = function () {
        function t(e) {
            p(this, t),
            this.styleID = 0,
            this.reset(),
            Yn(this, e, e)
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        var e = {};
                        return Yn(e, this, Bn),
                        new t(e)
                    }
                }, {
                    key: "reset",
                    value: function () {
                        Yn(this, Bn, Bn)
                    }
                }, {
                    key: "toFontString",
                    value: function () {
                        var t = "number" == typeof this.fontSize ? this.fontSize + "px" : this.fontSize,
                        e = this.fontFamily;
                        Array.isArray(this.fontFamily) || (e = this.fontFamily.split(","));
                        for (var i = e.length - 1; i >= 0; i--) {
                            var n = e[i].trim();
                            !/([\"\'])[^\'\"]+\1/.test(n) && Xn.indexOf(n) < 0 && (n = '"' + n + '"'),
                            e[i] = n
                        }
                        return this.fontStyle + " " + this.fontVariant + " " + this.fontWeight + " " + t + " " + e.join(",")
                    }
                }, {
                    key: "align",
                    get: function () {
                        return this._align
                    },
                    set: function (t) {
                        this._align !== t && (this._align = t, this.styleID++)
                    }
                }, {
                    key: "breakWords",
                    get: function () {
                        return this._breakWords
                    },
                    set: function (t) {
                        this._breakWords !== t && (this._breakWords = t, this.styleID++)
                    }
                }, {
                    key: "dropShadow",
                    get: function () {
                        return this._dropShadow
                    },
                    set: function (t) {
                        this._dropShadow !== t && (this._dropShadow = t, this.styleID++)
                    }
                }, {
                    key: "dropShadowAlpha",
                    get: function () {
                        return this._dropShadowAlpha
                    },
                    set: function (t) {
                        this._dropShadowAlpha !== t && (this._dropShadowAlpha = t, this.styleID++)
                    }
                }, {
                    key: "dropShadowAngle",
                    get: function () {
                        return this._dropShadowAngle
                    },
                    set: function (t) {
                        this._dropShadowAngle !== t && (this._dropShadowAngle = t, this.styleID++)
                    }
                }, {
                    key: "dropShadowBlur",
                    get: function () {
                        return this._dropShadowBlur
                    },
                    set: function (t) {
                        this._dropShadowBlur !== t && (this._dropShadowBlur = t, this.styleID++)
                    }
                }, {
                    key: "dropShadowColor",
                    get: function () {
                        return this._dropShadowColor
                    },
                    set: function (t) {
                        var e = Wn(t);
                        this._dropShadowColor !== e && (this._dropShadowColor = e, this.styleID++)
                    }
                }, {
                    key: "dropShadowDistance",
                    get: function () {
                        return this._dropShadowDistance
                    },
                    set: function (t) {
                        this._dropShadowDistance !== t && (this._dropShadowDistance = t, this.styleID++)
                    }
                }, {
                    key: "fill",
                    get: function () {
                        return this._fill
                    },
                    set: function (t) {
                        var e = Wn(t);
                        this._fill !== e && (this._fill = e, this.styleID++)
                    }
                }, {
                    key: "fillGradientType",
                    get: function () {
                        return this._fillGradientType
                    },
                    set: function (t) {
                        this._fillGradientType !== t && (this._fillGradientType = t, this.styleID++)
                    }
                }, {
                    key: "fillGradientStops",
                    get: function () {
                        return this._fillGradientStops
                    },
                    set: function (t) {
                        (function (t, e) {
                            if (!Array.isArray(t) || !Array.isArray(e))
                                return !1;
                            if (t.length !== e.length)
                                return !1;
                            for (var i = 0; i < t.length; ++i)
                                if (t[i] !== e[i])
                                    return !1;
                            return !0
                        })(this._fillGradientStops, t) || (this._fillGradientStops = t, this.styleID++)
                    }
                }, {
                    key: "fontFamily",
                    get: function () {
                        return this._fontFamily
                    },
                    set: function (t) {
                        this.fontFamily !== t && (this._fontFamily = t, this.styleID++)
                    }
                }, {
                    key: "fontSize",
                    get: function () {
                        return this._fontSize
                    },
                    set: function (t) {
                        this._fontSize !== t && (this._fontSize = t, this.styleID++)
                    }
                }, {
                    key: "fontStyle",
                    get: function () {
                        return this._fontStyle
                    },
                    set: function (t) {
                        this._fontStyle !== t && (this._fontStyle = t, this.styleID++)
                    }
                }, {
                    key: "fontVariant",
                    get: function () {
                        return this._fontVariant
                    },
                    set: function (t) {
                        this._fontVariant !== t && (this._fontVariant = t, this.styleID++)
                    }
                }, {
                    key: "fontWeight",
                    get: function () {
                        return this._fontWeight
                    },
                    set: function (t) {
                        this._fontWeight !== t && (this._fontWeight = t, this.styleID++)
                    }
                }, {
                    key: "letterSpacing",
                    get: function () {
                        return this._letterSpacing
                    },
                    set: function (t) {
                        this._letterSpacing !== t && (this._letterSpacing = t, this.styleID++)
                    }
                }, {
                    key: "lineHeight",
                    get: function () {
                        return this._lineHeight
                    },
                    set: function (t) {
                        this._lineHeight !== t && (this._lineHeight = t, this.styleID++)
                    }
                }, {
                    key: "leading",
                    get: function () {
                        return this._leading
                    },
                    set: function (t) {
                        this._leading !== t && (this._leading = t, this.styleID++)
                    }
                }, {
                    key: "lineJoin",
                    get: function () {
                        return this._lineJoin
                    },
                    set: function (t) {
                        this._lineJoin !== t && (this._lineJoin = t, this.styleID++)
                    }
                }, {
                    key: "miterLimit",
                    get: function () {
                        return this._miterLimit
                    },
                    set: function (t) {
                        this._miterLimit !== t && (this._miterLimit = t, this.styleID++)
                    }
                }, {
                    key: "padding",
                    get: function () {
                        return this._padding
                    },
                    set: function (t) {
                        this._padding !== t && (this._padding = t, this.styleID++)
                    }
                }, {
                    key: "stroke",
                    get: function () {
                        return this._stroke
                    },
                    set: function (t) {
                        var e = Wn(t);
                        this._stroke !== e && (this._stroke = e, this.styleID++)
                    }
                }, {
                    key: "strokeThickness",
                    get: function () {
                        return this._strokeThickness
                    },
                    set: function (t) {
                        this._strokeThickness !== t && (this._strokeThickness = t, this.styleID++)
                    }
                }, {
                    key: "textBaseline",
                    get: function () {
                        return this._textBaseline
                    },
                    set: function (t) {
                        this._textBaseline !== t && (this._textBaseline = t, this.styleID++)
                    }
                }, {
                    key: "trim",
                    get: function () {
                        return this._trim
                    },
                    set: function (t) {
                        this._trim !== t && (this._trim = t, this.styleID++)
                    }
                }, {
                    key: "whiteSpace",
                    get: function () {
                        return this._whiteSpace
                    },
                    set: function (t) {
                        this._whiteSpace !== t && (this._whiteSpace = t, this.styleID++)
                    }
                }, {
                    key: "wordWrap",
                    get: function () {
                        return this._wordWrap
                    },
                    set: function (t) {
                        this._wordWrap !== t && (this._wordWrap = t, this.styleID++)
                    }
                }, {
                    key: "wordWrapWidth",
                    get: function () {
                        return this._wordWrapWidth
                    },
                    set: function (t) {
                        this._wordWrapWidth !== t && (this._wordWrapWidth = t, this.styleID++)
                    }
                }
            ]),
        t
    }
    ();
    function Gn(t) {
        return "number" == typeof t ? gt(t) : ("string" == typeof t && 0 === t.indexOf("0x") && (t = t.replace("0x", "#")), t)
    }
    function Wn(t) {
        if (Array.isArray(t)) {
            for (var e = 0; e < t.length; ++e)
                t[e] = Gn(t[e]);
            return t
        }
        return Gn(t)
    }
    function Yn(t, e, i) {
        for (var n in i)
            Array.isArray(e[n]) ? t[n] = e[n].slice() : t[n] = e[n]
    }
    var Hn = function () {
        function t(e, i, n, r, s, a, o, h, u) {
            p(this, t),
            this.text = e,
            this.style = i,
            this.width = n,
            this.height = r,
            this.lines = s,
            this.lineWidths = a,
            this.lineHeight = o,
            this.maxLineWidth = h,
            this.fontProperties = u
        }
        return g(t, null, [{
                    key: "measureText",
                    value: function (e, i, n) {
                        var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : t._canvas;
                        n = void 0 === n || null === n ? i.wordWrap : n;
                        var s = i.toFontString(),
                        a = t.measureFont(s),
                        o = r.getContext("2d");
                        o.font = s;
                        for (var h = (n ? t.wordWrap(e, i, r) : e).split(/(?:\r\n|\r|\n)/), u = new Array(h.length), l = 0, c = 0; c < h.length; c++) {
                            var d = o.measureText(h[c]).width + (h[c].length - 1) * i.letterSpacing;
                            u[c] = d,
                            l = Math.max(l, d)
                        }
                        var f = l + i.strokeThickness;
                        i.dropShadow && (f += i.dropShadowDistance);
                        var v = i.lineHeight || a.fontSize + i.strokeThickness,
                        p = Math.max(v, a.fontSize + i.strokeThickness) + (h.length - 1) * (v + i.leading);
                        return i.dropShadow && (p += i.dropShadowDistance),
                        new t(e, i, f, p, h, u, v + i.leading, l, a)
                    }
                }, {
                    key: "wordWrap",
                    value: function (e, i) {
                        for (var n = (arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : t._canvas).getContext("2d"), r = 0, s = "", a = "", o = {}, h = i.letterSpacing, u = i.whiteSpace, l = t.collapseSpaces(u), c = t.collapseNewlines(u), d = !l, f = i.wordWrapWidth + h, v = t.tokenize(e), p = 0; p < v.length; p++) {
                            var g = v[p];
                            if (t.isNewline(g)) {
                                if (!c) {
                                    a += t.addLine(s),
                                    d = !l,
                                    s = "",
                                    r = 0;
                                    continue
                                }
                                g = " "
                            }
                            if (l) {
                                var y = t.isBreakingSpace(g),
                                _ = t.isBreakingSpace(s[s.length - 1]);
                                if (y && _)
                                    continue
                            }
                            var m = t.getFromCache(g, h, o, n);
                            if (m > f)
                                if ("" !== s && (a += t.addLine(s), s = "", r = 0), t.canBreakWords(g, i.breakWords))
                                    for (var x = g.split(""), T = 0; T < x.length; T++) {
                                        for (var w = x[T], b = 1; x[T + b]; ) {
                                            var E = x[T + b],
                                            k = w[w.length - 1];
                                            if (t.canBreakChars(k, E, g, T, i.breakWords))
                                                break;
                                            w += E,
                                            b++
                                        }
                                        T += w.length - 1;
                                        var S = t.getFromCache(w, h, o, n);
                                        S + r > f && (a += t.addLine(s), d = !1, s = "", r = 0),
                                        s += w,
                                        r += S
                                    }
                                else {
                                    s.length > 0 && (a += t.addLine(s), s = "", r = 0);
                                    var C = p === v.length - 1;
                                    a += t.addLine(g, !C),
                                    d = !1,
                                    s = "",
                                    r = 0
                                }
                            else
                                m + r > f && (d = !1, a += t.addLine(s), s = "", r = 0), (s.length > 0 || !t.isBreakingSpace(g) || d) && (s += g, r += m)
                        }
                        return a += t.addLine(s, !1)
                    }
                }, {
                    key: "addLine",
                    value: function (e) {
                        var i = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
                        return e = t.trimRight(e),
                        e = i ? e + "\n" : e
                    }
                }, {
                    key: "getFromCache",
                    value: function (t, e, i, n) {
                        var r = i[t];
                        if (void 0 === r) {
                            var s = t.length * e;
                            r = n.measureText(t).width + s,
                            i[t] = r
                        }
                        return r
                    }
                }, {
                    key: "collapseSpaces",
                    value: function (t) {
                        return "normal" === t || "pre-line" === t
                    }
                }, {
                    key: "collapseNewlines",
                    value: function (t) {
                        return "normal" === t
                    }
                }, {
                    key: "trimRight",
                    value: function (e) {
                        if ("string" != typeof e)
                            return "";
                        for (var i = e.length - 1; i >= 0; i--) {
                            var n = e[i];
                            if (!t.isBreakingSpace(n))
                                break;
                            e = e.slice(0, -1)
                        }
                        return e
                    }
                }, {
                    key: "isNewline",
                    value: function (e) {
                        return "string" == typeof e && t._newlines.indexOf(e.charCodeAt(0)) >= 0
                    }
                }, {
                    key: "isBreakingSpace",
                    value: function (e) {
                        return "string" == typeof e && t._breakingSpaces.indexOf(e.charCodeAt(0)) >= 0
                    }
                }, {
                    key: "tokenize",
                    value: function (e) {
                        var i = [],
                        n = "";
                        if ("string" != typeof e)
                            return i;
                        for (var r = 0; r < e.length; r++) {
                            var s = e[r];
                            t.isBreakingSpace(s) || t.isNewline(s) ? ("" !== n && (i.push(n), n = ""), i.push(s)) : n += s
                        }
                        return "" !== n && i.push(n),
                        i
                    }
                }, {
                    key: "canBreakWords",
                    value: function (t, e) {
                        return e
                    }
                }, {
                    key: "canBreakChars",
                    value: function (t, e, i, n, r) {
                        return !0
                    }
                }, {
                    key: "measureFont",
                    value: function (e) {
                        if (t._fonts[e])
                            return t._fonts[e];
                        var i = {},
                        n = t._canvas,
                        r = t._context;
                        r.font = e;
                        var s = t.METRICS_STRING + t.BASELINE_SYMBOL,
                        a = Math.ceil(r.measureText(s).width),
                        o = Math.ceil(r.measureText(t.BASELINE_SYMBOL).width),
                        h = 2 * o;
                        o = o * t.BASELINE_MULTIPLIER | 0,
                        n.width = a,
                        n.height = h,
                        r.fillStyle = "#f00",
                        r.fillRect(0, 0, a, h),
                        r.font = e,
                        r.textBaseline = "alphabetic",
                        r.fillStyle = "#000",
                        r.fillText(s, 0, o);
                        var u = r.getImageData(0, 0, a, h).data,
                        l = u.length,
                        c = 4 * a,
                        d = 0,
                        f = 0,
                        v = !1;
                        for (d = 0; d < o; ++d) {
                            for (var p = 0; p < c; p += 4)
                                if (255 !== u[f + p]) {
                                    v = !0;
                                    break
                                }
                            if (v)
                                break;
                            f += c
                        }
                        for (i.ascent = o - d, f = l - c, v = !1, d = h; d > o; --d) {
                            for (var g = 0; g < c; g += 4)
                                if (255 !== u[f + g]) {
                                    v = !0;
                                    break
                                }
                            if (v)
                                break;
                            f -= c
                        }
                        return i.descent = d - o,
                        i.fontSize = i.ascent + i.descent,
                        t._fonts[e] = i,
                        i
                    }
                }, {
                    key: "clearMetrics",
                    value: function () {
                        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
                        e ? delete t._fonts[e] : t._fonts = {}
                    }
                }
            ]),
        t
    }
    (),
    Vn = document.createElement("canvas");
    Vn.width = Vn.height = 10,
    Hn._canvas = Vn,
    Hn._context = Vn.getContext("2d"),
    Hn._fonts = {},
    Hn.METRICS_STRING = "|Ã‰q",
    Hn.BASELINE_SYMBOL = "M",
    Hn.BASELINE_MULTIPLIER = 1.4,
    Hn._newlines = [10, 13],
    Hn._breakingSpaces = [9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287, 12288];
    var zn = {
        texture: !0,
        children: !1,
        baseTexture: !0
    },
    qn = function (t) {
        function e(t, i, n) {
            p(this, e),
            (n = n || document.createElement("canvas")).width = 3,
            n.height = 3;
            var r = yi.fromCanvas(n, Ze.SCALE_MODE, "text");
            r.orig = new ee,
            r.trim = new ee;
            var s = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, r));
            return yi.addToCache(s._texture, s._texture.baseTexture.textureCacheIds[0]),
            s.canvas = n,
            s.context = s.canvas.getContext("2d"),
            s.resolution = Ze.RESOLUTION,
            s._text = null,
            s._style = null,
            s._styleListener = null,
            s._font = "",
            s.text = t,
            s.style = i,
            s.localStyleID = -1,
            s._contextScaleFlag = 1,
            s
        }
        return m(e, Sn),
        g(e, [{
                    key: "updateText",
                    value: function (t) {
                        var e = this._style;
                        if (this.localStyleID !== e.styleID && (this.dirty = !0, this.localStyleID = e.styleID), this.dirty || !t) {
                            this._font = this._style.toFontString();
                            var i = this.context,
                            n = Hn.measureText(this._text, this._style, this._style.wordWrap, this.canvas),
                            r = n.width,
                            s = n.height,
                            a = n.lines,
                            o = n.lineHeight,
                            h = n.lineWidths,
                            u = n.maxLineWidth,
                            l = n.fontProperties;
                            this.canvas.width = Math.ceil((Math.max(1, r) + 2 * e.padding) * this.resolution),
                            this.canvas.height = Math.ceil((Math.max(1, s) + 2 * e.padding) * this.resolution),
                            this.resolution !== this._contextScaleFlag && (i.scale(this.resolution, this.resolution), navigator.isCanvasPlus && "devtools" !== navigator.platform && (this._contextScaleFlag = this.resolution)),
                            i.clearRect(0, 0, this.canvas.width, this.canvas.height),
                            i.font = this._font,
                            i.strokeStyle = e.stroke,
                            i.lineWidth = e.strokeThickness,
                            i.textBaseline = e.textBaseline,
                            i.lineJoin = e.lineJoin,
                            i.miterLimit = e.miterLimit;
                            var c = void 0,
                            d = void 0;
                            if (e.dropShadow) {
                                i.fillStyle = e.dropShadowColor,
                                i.globalAlpha = e.dropShadowAlpha,
                                i.shadowBlur = e.dropShadowBlur,
                                e.dropShadowBlur > 0 && (i.shadowColor = e.dropShadowColor);
                                for (var f = Math.cos(e.dropShadowAngle) * e.dropShadowDistance, v = Math.sin(e.dropShadowAngle) * e.dropShadowDistance, p = 0; p < a.length; p++)
                                    c = e.strokeThickness / 2, d = e.strokeThickness / 2 + p * o + l.ascent, "right" === e.align ? c += u - h[p] : "center" === e.align && (c += (u - h[p]) / 2), e.fill && (this.drawLetterSpacing(a[p], c + f + e.padding, d + v + e.padding), e.stroke && e.strokeThickness && (i.strokeStyle = e.dropShadowColor, this.drawLetterSpacing(a[p], c + f + e.padding, d + v + e.padding, !0), i.strokeStyle = e.stroke))
                            }
                            i.shadowBlur = 0,
                            i.globalAlpha = 1,
                            i.fillStyle = this._generateFillStyle(e, a);
                            for (var g = 0; g < a.length; g++)
                                c = e.strokeThickness / 2, d = e.strokeThickness / 2 + g * o + l.ascent, "right" === e.align ? c += u - h[g] : "center" === e.align && (c += (u - h[g]) / 2), e.stroke && e.strokeThickness && this.drawLetterSpacing(a[g], c + e.padding, d + e.padding, !0), e.fill && this.drawLetterSpacing(a[g], c + e.padding, d + e.padding);
                            this.updateTexture()
                        }
                    }
                }, {
                    key: "drawLetterSpacing",
                    value: function (t, e, i) {
                        var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3],
                        r = this._style.letterSpacing;
                        if (0 !== r)
                            for (var s = String.prototype.split.call(t, ""), a = e, o = 0, h = ""; o < t.length; )
                                h = s[o++], n ? this.context.strokeText(h, a, i) : this.context.fillText(h, a, i), a += this.context.measureText(h).width + r;
                        else
                            n ? this.context.strokeText(t, e, i) : this.context.fillText(t, e, i)
                    }
                }, {
                    key: "updateTexture",
                    value: function () {
                        var t = this.canvas;
                        if (this._style.trim) {
                            var e = function (t) {
                                var e = t.width,
                                i = t.height,
                                n = t.getContext("2d"),
                                r = n.getImageData(0, 0, e, i).data,
                                s = r.length,
                                a = {
                                    top: null,
                                    left: null,
                                    right: null,
                                    bottom: null
                                },
                                o = null,
                                h = void 0,
                                u = void 0,
                                l = void 0;
                                for (h = 0; h < s; h += 4)
                                    0 !== r[h + 3] && (u = h / 4 % e, l = ~~(h / 4 / e), null === a.top && (a.top = l), null === a.left ? a.left = u : u < a.left && (a.left = u), null === a.right ? a.right = u + 1 : a.right < u && (a.right = u + 1), null === a.bottom ? a.bottom = l : a.bottom < l && (a.bottom = l));
                                return null !== a.top && (e = a.right - a.left, i = a.bottom - a.top + 1, o = n.getImageData(a.left, a.top, e, i)), {
                                    height: i,
                                    width: e,
                                    data: o
                                }
                            }
                            (t);
                            e.data && (t.width = e.width, t.height = e.height, this.context.putImageData(e.data, 0, 0))
                        }
                        var i = this._texture,
                        n = this._style,
                        r = n.trim ? 0 : n.padding,
                        s = i.baseTexture;
                        s.hasLoaded = !0,
                        s.resolution = this.resolution,
                        s.realWidth = t.width,
                        s.realHeight = t.height,
                        s.width = t.width / this.resolution,
                        s.height = t.height / this.resolution,
                        i.trim.width = i._frame.width = t.width / this.resolution,
                        i.trim.height = i._frame.height = t.height / this.resolution,
                        i.trim.x = -r,
                        i.trim.y = -r,
                        i.orig.width = i._frame.width - 2 * r,
                        i.orig.height = i._frame.height - 2 * r,
                        this._onTextureUpdate(),
                        s.emit("update", s),
                        this.dirty = !1
                    }
                }, {
                    key: "renderWebGL",
                    value: function (t) {
                        this.resolution !== t.resolution && (this.resolution = t.resolution, this.dirty = !0),
                        this.updateText(!0),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "renderWebGL", this).call(this, t)
                    }
                }, {
                    key: "_renderCanvas",
                    value: function (t) {
                        this.resolution !== t.resolution && (this.resolution = t.resolution, this.dirty = !0),
                        this.updateText(!0),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "_renderCanvas", this).call(this, t)
                    }
                }, {
                    key: "getLocalBounds",
                    value: function (t) {
                        return this.updateText(!0),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "getLocalBounds", this).call(this, t)
                    }
                }, {
                    key: "_calculateBounds",
                    value: function () {
                        this.updateText(!0),
                        this.calculateVertices(),
                        this._bounds.addQuad(this.vertexData)
                    }
                }, {
                    key: "_onStyleChange",
                    value: function () {
                        this.dirty = !0
                    }
                }, {
                    key: "_generateFillStyle",
                    value: function (t, e) {
                        if (!Array.isArray(t.fill))
                            return t.fill;
                        var i = void 0,
                        n = void 0,
                        r = void 0,
                        s = void 0,
                        a = this.canvas.width / this.resolution,
                        o = this.canvas.height / this.resolution,
                        h = t.fill.slice(),
                        u = t.fillGradientStops.slice();
                        if (!u.length)
                            for (var l = h.length + 1, c = 1; c < l; ++c)
                                u.push(c / l);
                        if (h.unshift(t.fill[0]), u.unshift(0), h.push(t.fill[t.fill.length - 1]), u.push(1), t.fillGradientType === jt.LINEAR_VERTICAL) {
                            i = this.context.createLinearGradient(a / 2, 0, a / 2, o),
                            n = (h.length + 1) * e.length,
                            r = 0;
                            for (var d = 0; d < e.length; d++) {
                                r += 1;
                                for (var f = 0; f < h.length; f++)
                                    s = "number" == typeof u[f] ? u[f] / e.length + d / e.length : r / n, i.addColorStop(s, h[f]), r++
                            }
                        } else {
                            i = this.context.createLinearGradient(0, o / 2, a, o / 2),
                            n = h.length + 1,
                            r = 1;
                            for (var v = 0; v < h.length; v++)
                                s = "number" == typeof u[v] ? u[v] : r / n, i.addColorStop(s, h[v]), r++
                        }
                        return i
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        "boolean" == typeof t && (t = {
                                children: t
                            }),
                        t = Object.assign({}, zn, t),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, t),
                        this.context = null,
                        this.canvas = null,
                        this._style = null
                    }
                }, {
                    key: "width",
                    get: function () {
                        return this.updateText(!0),
                        Math.abs(this.scale.x) * this._texture.orig.width
                    },
                    set: function (t) {
                        this.updateText(!0);
                        var e = Math.sign(this.scale.x) || 1;
                        this.scale.x = e * t / this._texture.orig.width,
                        this._width = t
                    }
                }, {
                    key: "height",
                    get: function () {
                        return this.updateText(!0),
                        Math.abs(this.scale.y) * this._texture.orig.height
                    },
                    set: function (t) {
                        this.updateText(!0);
                        var e = Math.sign(this.scale.y) || 1;
                        this.scale.y = e * t / this._texture.orig.height,
                        this._height = t
                    }
                }, {
                    key: "style",
                    get: function () {
                        return this._style
                    },
                    set: function (t) {
                        t = t || {},
                        this._style = t instanceof jn ? t : new jn(t),
                        this.localStyleID = -1,
                        this.dirty = !0
                    }
                }, {
                    key: "text",
                    get: function () {
                        return this._text
                    },
                    set: function (t) {
                        t = String("" === t || null === t || void 0 === t ? " " : t),
                        this._text !== t && (this._text = t, this.dirty = !0)
                    }
                }
            ]),
        e
    }
    (),
    Kn = function () {
        function t(e, i, n, r, s, a, o, h, u) {
            p(this, t),
            this.lineWidth = e,
            this.lineAlignment = u,
            this.nativeLines = o,
            this.lineColor = i,
            this.lineAlpha = n,
            this._lineTint = i,
            this.fillColor = r,
            this.fillAlpha = s,
            this._fillTint = r,
            this.fill = a,
            this.holes = [],
            this.shape = h,
            this.type = h.type
        }
        return g(t, [{
                    key: "clone",
                    value: function () {
                        return new t(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.nativeLines, this.shape)
                    }
                }, {
                    key: "addHole",
                    value: function (t) {
                        this.holes.push(t)
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.shape = null,
                        this.holes = null
                    }
                }
            ]),
        t
    }
    ();
    var Zn = void 0,
    Jn = new Vt,
    Qn = new Yt,
    $n = new Float32Array(4),
    tr = new Float32Array(4),
    er = function (t) {
        function e() {
            var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return i.fillAlpha = 1,
            i.lineWidth = 0,
            i.nativeLines = t,
            i.lineColor = 0,
            i.lineAlignment = .5,
            i.graphicsData = [],
            i.tint = 16777215,
            i._prevTint = 16777215,
            i.blendMode = Dt.NORMAL,
            i.currentPath = null,
            i._webGL = {},
            i.isMask = !1,
            i.boundsPadding = 0,
            i._localBounds = new oi,
            i.dirty = 0,
            i.fastRectDirty = -1,
            i.clearDirty = 0,
            i.boundsDirty = -1,
            i.cachedSpriteDirty = !1,
            i._spriteRect = null,
            i._fastRect = !1,
            i._prevRectTint = null,
            i._prevRectFillColor = null,
            i
        }
        return m(e, ui),
        g(e, [{
                    key: "clone",
                    value: function () {
                        var t = new e;
                        t.renderable = this.renderable,
                        t.fillAlpha = this.fillAlpha,
                        t.lineWidth = this.lineWidth,
                        t.lineColor = this.lineColor,
                        t.lineAlignment = this.lineAlignment,
                        t.tint = this.tint,
                        t.blendMode = this.blendMode,
                        t.isMask = this.isMask,
                        t.boundsPadding = this.boundsPadding,
                        t.dirty = 0,
                        t.cachedSpriteDirty = this.cachedSpriteDirty;
                        for (var i = 0; i < this.graphicsData.length; ++i)
                            t.graphicsData.push(this.graphicsData[i].clone());
                        return t.currentPath = t.graphicsData[t.graphicsData.length - 1],
                        t.updateLocalBounds(),
                        t
                    }
                }, {
                    key: "_quadraticCurveLength",
                    value: function (t, e, i, n, r, s) {
                        var a = t - (2 * i + r),
                        o = e - (2 * n + s),
                        h = (i - 2) * t * 2,
                        u = (n - 2) * e * 2,
                        l = 4 * (a * a + o * o),
                        c = 4 * (a * h + o * u),
                        d = h * h + u * u,
                        f = 2 * Math.sqrt(l + c + d),
                        v = Math.sqrt(l),
                        p = 2 * l * v,
                        g = 2 * Math.sqrt(d),
                        y = c / v;
                        return (p * f + v * c * (f - g) + (4 * d * l - c * c) * Math.log((2 * v + y + f) / (y + g))) / (4 * p)
                    }
                }, {
                    key: "_bezierCurveLength",
                    value: function (t, e, i, n, r, s, a, o) {
                        for (var h = 0, u = 0, l = 0, c = 0, d = 0, f = 0, v = 0, p = 0, g = 0, y = 0, _ = 0, m = t, x = e, T = 1; T <= 10; ++T)
                            y = m - (p = (v = (f = (d = 1 - (u = T / 10)) * d) * d) * t + 3 * f * u * i + 3 * d * (l = u * u) * r + (c = l * u) * a), _ = x - (g = v * e + 3 * f * u * n + 3 * d * l * s + c * o), m = p, x = g, h += Math.sqrt(y * y + _ * _);
                        return h
                    }
                }, {
                    key: "_segmentsCount",
                    value: function (t) {
                        var i = Math.ceil(t / e.CURVES.maxLength);
                        return i < e.CURVES.minSegments ? i = e.CURVES.minSegments : i > e.CURVES.maxSegments && (i = e.CURVES.maxSegments),
                        i
                    }
                }, {
                    key: "lineStyle",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                        e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                        i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1,
                        n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : .5;
                        if (this.lineWidth = t, this.lineColor = e, this.lineAlpha = i, this.lineAlignment = n, this.currentPath)
                            if (this.currentPath.shape.points.length) {
                                var r = new re(this.currentPath.shape.points.slice(-2));
                                r.closed = !1,
                                this.drawShape(r)
                            } else
                                this.currentPath.lineWidth = this.lineWidth, this.currentPath.lineColor = this.lineColor, this.currentPath.lineAlpha = this.lineAlpha, this.currentPath.lineAlignment = this.lineAlignment;
                        return this
                    }
                }, {
                    key: "moveTo",
                    value: function (t, e) {
                        var i = new re([t, e]);
                        return i.closed = !1,
                        this.drawShape(i),
                        this
                    }
                }, {
                    key: "lineTo",
                    value: function (t, e) {
                        var i = this.currentPath.shape.points,
                        n = i[i.length - 2],
                        r = i[i.length - 1];
                        return n === t && r === e || (i.push(t, e), this.dirty++),
                        this
                    }
                }, {
                    key: "quadraticCurveTo",
                    value: function (t, i, n, r) {
                        this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
                        var s = this.currentPath.shape.points,
                        a = 0,
                        o = 0;
                        0 === s.length && this.moveTo(0, 0);
                        for (var h = s[s.length - 2], u = s[s.length - 1], l = e.CURVES.adaptive ? this._segmentsCount(this._quadraticCurveLength(h, u, t, i, n, r)) : 20, c = 1; c <= l; ++c) {
                            var d = c / l;
                            a = h + (t - h) * d,
                            o = u + (i - u) * d,
                            s.push(a + (t + (n - t) * d - a) * d, o + (i + (r - i) * d - o) * d)
                        }
                        return this.dirty++,
                        this
                    }
                }, {
                    key: "bezierCurveTo",
                    value: function (t, i, n, r, s, a) {
                        this.currentPath ? 0 === this.currentPath.shape.points.length && (this.currentPath.shape.points = [0, 0]) : this.moveTo(0, 0);
                        var o = this.currentPath.shape.points,
                        h = o[o.length - 2],
                        u = o[o.length - 1];
                        return o.length -= 2,
                        function (t, e, i, n, r, s, a, o, h) {
                            var u = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : [],
                            l = 0,
                            c = 0,
                            d = 0,
                            f = 0,
                            v = 0;
                            u.push(t, e);
                            for (var p = 1, g = 0; p <= h; ++p)
                                d = (c = (l = 1 - (g = p / h)) * l) * l, v = (f = g * g) * g, u.push(d * t + 3 * c * g * i + 3 * l * f * r + v * a, d * e + 3 * c * g * n + 3 * l * f * s + v * o)
                        }
                        (h, u, t, i, n, r, s, a, e.CURVES.adaptive ? this._segmentsCount(this._bezierCurveLength(h, u, t, i, n, r, s, a)) : 20, o),
                        this.dirty++,
                        this
                    }
                }, {
                    key: "arcTo",
                    value: function (t, e, i, n, r) {
                        this.currentPath ? 0 === this.currentPath.shape.points.length && this.currentPath.shape.points.push(t, e) : this.moveTo(t, e);
                        var s = this.currentPath.shape.points,
                        a = s[s.length - 2],
                        o = s[s.length - 1] - e,
                        h = a - t,
                        u = n - e,
                        l = i - t,
                        c = Math.abs(o * l - h * u);
                        if (c < 1e-8 || 0 === r)
                            s[s.length - 2] === t && s[s.length - 1] === e || s.push(t, e);
                        else {
                            var d = o * o + h * h,
                            f = u * u + l * l,
                            v = o * u + h * l,
                            p = r * Math.sqrt(d) / c,
                            g = r * Math.sqrt(f) / c,
                            y = p * v / d,
                            _ = g * v / f,
                            m = p * l + g * h,
                            x = p * u + g * o,
                            T = h * (g + y),
                            w = o * (g + y),
                            b = l * (p + _),
                            E = u * (p + _),
                            k = Math.atan2(w - x, T - m),
                            S = Math.atan2(E - x, b - m);
                            this.arc(m + t, x + e, r, k, S, h * u > l * o)
                        }
                        return this.dirty++,
                        this
                    }
                }, {
                    key: "arc",
                    value: function (t, i, n, r, s) {
                        var a = arguments.length > 5 && void 0 !== arguments[5] && arguments[5];
                        if (r === s)
                            return this;
                        !a && s <= r ? s += tt : a && r <= s && (r += tt);
                        var o = s - r,
                        h = e.CURVES.adaptive ? this._segmentsCount(Math.abs(o) * n) : 40 * Math.ceil(Math.abs(o) / tt);
                        if (0 === o)
                            return this;
                        var u = t + Math.cos(r) * n,
                        l = i + Math.sin(r) * n,
                        c = this.currentPath ? this.currentPath.shape.points : null;
                        if (c) {
                            var d = Math.abs(c[c.length - 2] - u),
                            f = Math.abs(c[c.length - 1] - l);
                            d < .001 && f < .001 || c.push(u, l)
                        } else
                            this.moveTo(u, l), c = this.currentPath.shape.points;
                        for (var v = o / (2 * h), p = 2 * v, g = Math.cos(v), y = Math.sin(v), _ = h - 1, m = _ % 1 / _, x = 0; x <= _; ++x) {
                            var T = v + r + p * (x + m * x),
                            w = Math.cos(T),
                            b = -Math.sin(T);
                            c.push((g * w + y * b) * n + t, (g * -b + y * w) * n + i)
                        }
                        return this.dirty++,
                        this
                    }
                }, {
                    key: "beginFill",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0,
                        e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
                        return this.filling = !0,
                        this.fillColor = t,
                        this.fillAlpha = e,
                        this.currentPath && this.currentPath.shape.points.length <= 2 && (this.currentPath.fill = this.filling, this.currentPath.fillColor = this.fillColor, this.currentPath.fillAlpha = this.fillAlpha),
                        this
                    }
                }, {
                    key: "endFill",
                    value: function () {
                        return this.filling = !1,
                        this.fillColor = null,
                        this.fillAlpha = 1,
                        this
                    }
                }, {
                    key: "drawRect",
                    value: function (t, e, i, n) {
                        return this.drawShape(new ee(t, e, i, n)),
                        this
                    }
                }, {
                    key: "drawRoundedRect",
                    value: function (t, e, i, n, r) {
                        return this.drawShape(new se(t, e, i, n, r)),
                        this
                    }
                }, {
                    key: "drawCircle",
                    value: function (t, e, i) {
                        return this.drawShape(new ie(t, e, i)),
                        this
                    }
                }, {
                    key: "drawEllipse",
                    value: function (t, e, i, n) {
                        return this.drawShape(new ne(t, e, i, n)),
                        this
                    }
                }, {
                    key: "drawPolygon",
                    value: function (t) {
                        var e = t,
                        i = !0;
                        if (e instanceof re && (i = e.closed, e = e.points), !Array.isArray(e)) {
                            e = new Array(arguments.length);
                            for (var n = 0; n < e.length; ++n)
                                e[n] = arguments[n]
                        }
                        var r = new re(e);
                        return r.closed = i,
                        this.drawShape(r),
                        this
                    }
                }, {
                    key: "drawStar",
                    value: function (t, e, i, n, r) {
                        var s = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : 0;
                        r = r || n / 2;
                        for (var a = -1 * Math.PI / 2 + s, o = 2 * i, h = tt / o, u = [], l = 0; l < o; l++) {
                            var c = l % 2 ? r : n,
                            d = l * h + a;
                            u.push(t + c * Math.cos(d), e + c * Math.sin(d))
                        }
                        return this.drawPolygon(u)
                    }
                }, {
                    key: "clear",
                    value: function () {
                        return (this.lineWidth || this.filling || this.graphicsData.length > 0) && (this.lineWidth = 0, this.lineAlignment = .5, this.filling = !1, this.boundsDirty = -1, this.canvasTintDirty = -1, this.dirty++, this.clearDirty++, this.graphicsData.length = 0),
                        this.currentPath = null,
                        this._spriteRect = null,
                        this
                    }
                }, {
                    key: "isFastRect",
                    value: function () {
                        return 1 === this.graphicsData.length && this.graphicsData[0].shape.type === Bt.RECT && !this.graphicsData[0].lineWidth
                    }
                }, {
                    key: "_renderWebGL",
                    value: function (t) {
                        this.dirty !== this.fastRectDirty && (this.fastRectDirty = this.dirty, this._fastRect = this.isFastRect()),
                        this._fastRect ? this._renderSpriteRect(t) : (t.setObjectRenderer(t.plugins.graphics), t.plugins.graphics.render(this))
                    }
                }, {
                    key: "_renderSpriteRect",
                    value: function (t) {
                        var e = this.graphicsData[0].shape;
                        this._spriteRect || (this._spriteRect = new Sn(new yi(yi.WHITE)));
                        var i = this._spriteRect,
                        n = this.graphicsData[0].fillColor;
                        if (16777215 === this.tint)
                            i.tint = n;
                        else if (this.tint !== this._prevRectTint || n !== this._prevRectFillColor) {
                            var r = $n,
                            s = tr;
                            pt(n, r),
                            pt(this.tint, s),
                            r[0] *= s[0],
                            r[1] *= s[1],
                            r[2] *= s[2],
                            i.tint = yt(r),
                            this._prevRectTint = this.tint,
                            this._prevRectFillColor = n
                        }
                        i.alpha = this.graphicsData[0].fillAlpha,
                        i.worldAlpha = this.worldAlpha * i.alpha,
                        i.blendMode = this.blendMode,
                        i._texture._frame.width = e.width,
                        i._texture._frame.height = e.height,
                        i.transform.worldTransform = this.transform.worldTransform,
                        i.anchor.set(-e.x / e.width, -e.y / e.height),
                        i._onAnchorUpdate(),
                        i._renderWebGL(t)
                    }
                }, {
                    key: "_renderCanvas",
                    value: function (t) {
                        !0 !== this.isMask && t.plugins.graphics.render(this)
                    }
                }, {
                    key: "_calculateBounds",
                    value: function () {
                        this.boundsDirty !== this.dirty && (this.boundsDirty = this.dirty, this.updateLocalBounds(), this.cachedSpriteDirty = !0);
                        var t = this._localBounds;
                        this._bounds.addFrame(this.transform, t.minX, t.minY, t.maxX, t.maxY)
                    }
                }, {
                    key: "containsPoint",
                    value: function (t) {
                        this.worldTransform.applyInverse(t, Qn);
                        for (var e = this.graphicsData, i = 0; i < e.length; ++i) {
                            var n = e[i];
                            if (n.fill && (n.shape && n.shape.contains(Qn.x, Qn.y))) {
                                if (n.holes)
                                    for (var r = 0; r < n.holes.length; r++) {
                                        if (n.holes[r].contains(Qn.x, Qn.y))
                                            return !1
                                    }
                                return !0
                            }
                        }
                        return !1
                    }
                }, {
                    key: "updateLocalBounds",
                    value: function () {
                        var t = 1 / 0,
                        e = -1 / 0,
                        i = 1 / 0,
                        n = -1 / 0;
                        if (this.graphicsData.length)
                            for (var r = 0, s = 0, a = 0, o = 0, h = 0, u = 0; u < this.graphicsData.length; u++) {
                                var l = this.graphicsData[u],
                                c = l.type,
                                d = l.lineWidth;
                                if (r = l.shape, c === Bt.RECT || c === Bt.RREC)
                                    s = r.x - d / 2, a = r.y - d / 2, o = r.width + d, h = r.height + d, t = s < t ? s : t, e = s + o > e ? s + o : e, i = a < i ? a : i, n = a + h > n ? a + h : n;
                                else if (c === Bt.CIRC)
                                    s = r.x, a = r.y, o = r.radius + d / 2, h = r.radius + d / 2, t = s - o < t ? s - o : t, e = s + o > e ? s + o : e, i = a - h < i ? a - h : i, n = a + h > n ? a + h : n;
                                else if (c === Bt.ELIP)
                                    s = r.x, a = r.y, o = r.width + d / 2, h = r.height + d / 2, t = s - o < t ? s - o : t, e = s + o > e ? s + o : e, i = a - h < i ? a - h : i, n = a + h > n ? a + h : n;
                                else
                                    for (var f = r.points, v = 0, p = 0, g = 0, y = 0, _ = 0, m = 0, x = 0, T = 0, w = 0; w + 2 < f.length; w += 2)
                                        s = f[w], a = f[w + 1], v = f[w + 2], p = f[w + 3], g = Math.abs(v - s), y = Math.abs(p - a), h = d, (o = Math.sqrt(g * g + y * y)) < 1e-9 || (m = (h / o * g + y) / 2, T = (p + a) / 2, t = (x = (v + s) / 2) - (_ = (h / o * y + g) / 2) < t ? x - _ : t, e = x + _ > e ? x + _ : e, i = T - m < i ? T - m : i, n = T + m > n ? T + m : n)
                            }
                        else
                            t = 0, e = 0, i = 0, n = 0;
                        var b = this.boundsPadding;
                        this._localBounds.minX = t - b,
                        this._localBounds.maxX = e + b,
                        this._localBounds.minY = i - b,
                        this._localBounds.maxY = n + b
                    }
                }, {
                    key: "drawShape",
                    value: function (t) {
                        this.currentPath && this.currentPath.shape.points.length <= 2 && this.graphicsData.pop(),
                        this.currentPath = null;
                        var e = new Kn(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, this.nativeLines, t, this.lineAlignment);
                        return this.graphicsData.push(e),
                        e.type === Bt.POLY && (e.shape.closed = e.shape.closed || this.filling, this.currentPath = e),
                        this.dirty++,
                        e
                    }
                }, {
                    key: "generateCanvasTexture",
                    value: function (t) {
                        var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1,
                        i = this.getLocalBounds(),
                        n = mi.create(i.width, i.height, t, e);
                        Zn || (Zn = new Si),
                        this.transform.updateLocalTransform(),
                        this.transform.localTransform.copy(Jn),
                        Jn.invert(),
                        Jn.tx -= i.x,
                        Jn.ty -= i.y,
                        Zn.render(this, n, !0, Jn);
                        var r = yi.fromCanvas(n.baseTexture._canvasRenderTarget.canvas, t, "graphics");
                        return r.baseTexture.resolution = e,
                        r.baseTexture.update(),
                        r
                    }
                }, {
                    key: "closePath",
                    value: function () {
                        var t = this.currentPath;
                        return t && t.shape && t.shape.close(),
                        this
                    }
                }, {
                    key: "addHole",
                    value: function () {
                        var t = this.graphicsData.pop();
                        return this.currentPath = this.graphicsData[this.graphicsData.length - 1],
                        this.currentPath.addHole(t.shape),
                        this.currentPath = null,
                        this
                    }
                }, {
                    key: "destroy",
                    value: function (t) {
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "destroy", this).call(this, t);
                        for (var i = 0; i < this.graphicsData.length; ++i)
                            this.graphicsData[i].destroy();
                        for (var n in this._webGL)
                            for (var r = 0; r < this._webGL[n].data.length; ++r)
                                this._webGL[n].data[r].destroy();
                        this._spriteRect && this._spriteRect.destroy(),
                        this.graphicsData = null,
                        this.currentPath = null,
                        this._webGL = null,
                        this._localBounds = null
                    }
                }
            ]),
        e
    }
    ();
    er._SPRITE_TEXTURE = null,
    er.CURVES = {
        adaptive: !1,
        maxLength: 10,
        minSegments: 8,
        maxSegments: 2048
    };
    var ir = function () {
        function t(e, i, n) {
            p(this, t),
            this.gl = e,
            this.color = [0, 0, 0],
            this.points = [],
            this.indices = [],
            this.buffer = en.GLBuffer.createVertexBuffer(e),
            this.indexBuffer = en.GLBuffer.createIndexBuffer(e),
            this.dirty = !0,
            this.nativeLines = !1,
            this.glPoints = null,
            this.glIndices = null,
            this.shader = i,
            this.vao = new en.VertexArrayObject(e, n).addIndex(this.indexBuffer).addAttribute(this.buffer, i.attributes.aVertexPosition, e.FLOAT, !1, 24, 0).addAttribute(this.buffer, i.attributes.aColor, e.FLOAT, !1, 24, 8)
        }
        return g(t, [{
                    key: "reset",
                    value: function () {
                        this.points.length = 0,
                        this.indices.length = 0
                    }
                }, {
                    key: "upload",
                    value: function () {
                        this.glPoints = new Float32Array(this.points),
                        this.buffer.upload(this.glPoints),
                        this.glIndices = new Uint16Array(this.indices),
                        this.indexBuffer.upload(this.glIndices),
                        this.dirty = !1
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.color = null,
                        this.points = null,
                        this.indices = null,
                        this.vao.destroy(),
                        this.buffer.destroy(),
                        this.indexBuffer.destroy(),
                        this.gl = null,
                        this.buffer = null,
                        this.indexBuffer = null,
                        this.glPoints = null,
                        this.glIndices = null
                    }
                }
            ]),
        t
    }
    (),
    nr = function (t) {
        function e(t) {
            return p(this, e),
            x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, "\nattribute vec2 aVertexPosition;\nattribute vec4 aColor;\n\nuniform mat3 translationMatrix;\nuniform mat3 projectionMatrix;\n\nuniform float alpha;\nuniform vec3 tint;\n\nvarying vec4 vColor;\n\nvoid main(void){\n  gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n  vColor = aColor * vec4(tint * alpha, alpha);\n}\n", "\nvarying vec4 vColor;\n\nvoid main(void){\n  gl_FragColor = vColor;\n}\n"))
        }
        return m(e, gn),
        e
    }
    ();
    function rr(t, e, i) {
        t.nativeLines ? function (t, e) {
            var i = 0,
            n = t.points;
            if (0 === n.length)
                return;
            var r = e.points,
            s = n.length / 2,
            a = pt(t.lineColor),
            o = t.lineAlpha,
            h = a[0] * o,
            u = a[1] * o,
            l = a[2] * o;
            for (i = 1; i < s; i++) {
                var c = n[2 * (i - 1)],
                d = n[2 * (i - 1) + 1],
                f = n[2 * i],
                v = n[2 * i + 1];
                r.push(c, d),
                r.push(h, u, l, o),
                r.push(f, v),
                r.push(h, u, l, o)
            }
        }
        (t, i) : function (t, e) {
            var i = t.points;
            if (0 === i.length)
                return;
            var n = new Yt(i[0], i[1]),
            r = new Yt(i[i.length - 2], i[i.length - 1]);
            if (n.x === r.x && n.y === r.y) {
                (i = i.slice()).pop(),
                i.pop();
                var s = (r = new Yt(i[i.length - 2], i[i.length - 1])).x + .5 * (n.x - r.x),
                a = r.y + .5 * (n.y - r.y);
                i.unshift(s, a),
                i.push(s, a)
            }
            var o = e.points,
            h = e.indices,
            u = i.length / 2,
            l = i.length,
            c = o.length / 6,
            d = t.lineWidth / 2,
            f = pt(t.lineColor),
            v = t.lineAlpha,
            p = f[0] * v,
            g = f[1] * v,
            y = f[2] * v,
            _ = i[0],
            m = i[1],
            x = i[2],
            T = i[3],
            w = 0,
            b = 0,
            E =  - (m - T),
            k = _ - x,
            S = 0,
            C = 0,
            O = 0,
            P = 0,
            M = Math.sqrt(E * E + k * k);
            E /= M,
            k /= M,
            E *= d,
            k *= d;
            var A = t.lineAlignment,
            I = 2 * (1 - A),
            R = 2 * A;
            o.push(_ - E * I, m - k * I, p, g, y, v),
            o.push(_ + E * R, m + k * R, p, g, y, v);
            for (var D = 1; D < u - 1; ++D) {
                _ = i[2 * (D - 1)],
                m = i[2 * (D - 1) + 1],
                x = i[2 * D],
                T = i[2 * D + 1],
                w = i[2 * (D + 1)],
                b = i[2 * (D + 1) + 1],
                E =  - (m - T),
                k = _ - x,
                M = Math.sqrt(E * E + k * k),
                E /= M,
                k /= M,
                E *= d,
                k *= d,
                S =  - (T - b),
                C = x - w,
                M = Math.sqrt(S * S + C * C),
                S /= M,
                C /= M;
                var L = -k + m - (-k + T),
                F = -E + x - (-E + _),
                N = (-E + _) * (-k + T) - (-E + x) * (-k + m),
                U =  - (C *= d) + b - (-C + T),
                B =  - (S *= d) + x - (-S + w),
                X = (-S + w) * (-C + T) - (-S + x) * (-C + b),
                j = L * B - U * F;
                if (Math.abs(j) < .1)
                    j += 10.1, o.push(x - E * I, T - k * I, p, g, y, v), o.push(x + E * R, T + k * R, p, g, y, v);
                else {
                    var G = (F * X - B * N) / j,
                    W = (U * N - L * X) / j,
                    Y = (G - x) * (G - x) + (W - T) * (W - T);
                    Y > 196 * d * d ? (O = E - S, P = k - C, M = Math.sqrt(O * O + P * P), O /= M, P /= M, O *= d, P *= d, o.push(x - O * I, T - P * I), o.push(p, g, y, v), o.push(x + O * R, T + P * R), o.push(p, g, y, v), o.push(x - O * R * I, T - P * I), o.push(p, g, y, v), l++) : (o.push(x + (G - x) * I, T + (W - T) * I), o.push(p, g, y, v), o.push(x - (G - x) * R, T - (W - T) * R), o.push(p, g, y, v))
                }
            }
            _ = i[2 * (u - 2)],
            m = i[2 * (u - 2) + 1],
            x = i[2 * (u - 1)],
            T = i[2 * (u - 1) + 1],
            E =  - (m - T),
            k = _ - x,
            M = Math.sqrt(E * E + k * k),
            E /= M,
            k /= M,
            E *= d,
            k *= d,
            o.push(x - E * I, T - k * I),
            o.push(p, g, y, v),
            o.push(x + E * R, T + k * R),
            o.push(p, g, y, v),
            h.push(c);
            for (var H = 0; H < l; ++H)
                h.push(c++);
            h.push(c - 1)
        }
        (t, e)
    }
    function sr(t, e, i) {
        t.points = t.shape.points.slice();
        var n = t.points;
        if (t.fill && n.length >= 6) {
            for (var r = [], s = t.holes, a = 0; a < s.length; a++) {
                var o = s[a];
                r.push(n.length / 2),
                n = n.concat(o.points)
            }
            var h = e.points,
            u = e.indices,
            l = n.length / 2,
            c = pt(t.fillColor),
            d = t.fillAlpha,
            f = c[0] * d,
            v = c[1] * d,
            p = c[2] * d,
            g = oe(n, r, 2);
            if (!g)
                return;
            for (var y = h.length / 6, _ = 0; _ < g.length; _ += 3)
                u.push(g[_] + y), u.push(g[_] + y), u.push(g[_ + 1] + y), u.push(g[_ + 2] + y), u.push(g[_ + 2] + y);
            for (var m = 0; m < l; m++)
                h.push(n[2 * m], n[2 * m + 1], f, v, p, d)
        }
        t.lineWidth > 0 && rr(t, e, i)
    }
    function ar(t, e, i) {
        var n = t.shape,
        r = n.x,
        s = n.y,
        a = n.width,
        o = n.height;
        if (t.fill) {
            var h = pt(t.fillColor),
            u = t.fillAlpha,
            l = h[0] * u,
            c = h[1] * u,
            d = h[2] * u,
            f = e.points,
            v = e.indices,
            p = f.length / 6;
            f.push(r, s),
            f.push(l, c, d, u),
            f.push(r + a, s),
            f.push(l, c, d, u),
            f.push(r, s + o),
            f.push(l, c, d, u),
            f.push(r + a, s + o),
            f.push(l, c, d, u),
            v.push(p, p, p + 1, p + 2, p + 3, p + 3)
        }
        if (t.lineWidth) {
            var g = t.points;
            t.points = [r, s, r + a, s, r + a, s + o, r, s + o, r, s],
            rr(t, e, i),
            t.points = g
        }
    }
    function or(t, e, i) {
        var n = t.shape,
        r = n.x,
        s = n.y,
        a = n.width,
        o = n.height,
        h = n.radius,
        u = [];
        if (u.push(r, s + h), ur(r, s + o - h, r, s + o, r + h, s + o, u), ur(r + a - h, s + o, r + a, s + o, r + a, s + o - h, u), ur(r + a, s + h, r + a, s, r + a - h, s, u), ur(r + h, s, r, s, r, s + h + 1e-10, u), t.fill) {
            for (var l = pt(t.fillColor), c = t.fillAlpha, d = l[0] * c, f = l[1] * c, v = l[2] * c, p = e.points, g = e.indices, y = p.length / 6, _ = oe(u, null, 2), m = 0, x = _.length; m < x; m += 3)
                g.push(_[m] + y), g.push(_[m] + y), g.push(_[m + 1] + y), g.push(_[m + 2] + y), g.push(_[m + 2] + y);
            for (var T = 0, w = u.length; T < w; T++)
                p.push(u[T], u[++T], d, f, v, c)
        }
        if (t.lineWidth) {
            var b = t.points;
            t.points = u,
            rr(t, e, i),
            t.points = b
        }
    }
    function hr(t, e, i) {
        return t + (e - t) * i
    }
    function ur(t, e, i, n, r, s) {
        for (var a = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : [], o = 0, h = 0, u = 0, l = 0, c = 0, d = 0, f = 0, v = 0; f <= 20; ++f)
            o = hr(t, i, v = f / 20), h = hr(e, n, v), u = hr(i, r, v), l = hr(n, s, v), c = hr(o, u, v), d = hr(h, l, v), a.push(c, d);
        return a
    }
    function lr(t, e, i) {
        var n = t.shape,
        r = n.x,
        s = n.y,
        a = void 0,
        o = void 0;
        if (t.type === Bt.CIRC ? (a = n.radius, o = n.radius) : (a = n.width, o = n.height), 0 !== a && 0 !== o) {
            var h = Math.floor(30 * Math.sqrt(n.radius)) || Math.floor(15 * Math.sqrt(n.width + n.height)),
            u = 2 * Math.PI / h;
            if (t.fill) {
                var l = pt(t.fillColor),
                c = t.fillAlpha,
                d = l[0] * c,
                f = l[1] * c,
                v = l[2] * c,
                p = e.points,
                g = e.indices,
                y = p.length / 6;
                g.push(y);
                for (var _ = 0; _ < h + 1; _++)
                    p.push(r, s, d, f, v, c), p.push(r + Math.sin(u * _) * a, s + Math.cos(u * _) * o, d, f, v, c), g.push(y++, y++);
                g.push(y - 1)
            }
            if (t.lineWidth) {
                var m = t.points;
                t.points = [];
                for (var x = 0; x < h; x++)
                    t.points.push(r + Math.sin(u * -x) * a, s + Math.cos(u * -x) * o);
                t.points.push(t.points[0], t.points[1]),
                rr(t, e, i),
                t.points = m
            }
        }
    }
    var cr = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
            return i.graphicsDataPool = [],
            i.primitiveShader = null,
            i.gl = t.gl,
            i.CONTEXT_UID = 0,
            i
        }
        return m(e, mn),
        g(e, [{
                    key: "onContextChange",
                    value: function () {
                        this.gl = this.renderer.gl,
                        this.CONTEXT_UID = this.renderer.CONTEXT_UID,
                        this.primitiveShader = new nr(this.gl)
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        mn.prototype.destroy.call(this);
                        for (var t = 0; t < this.graphicsDataPool.length; ++t)
                            this.graphicsDataPool[t].destroy();
                        this.graphicsDataPool = null
                    }
                }, {
                    key: "render",
                    value: function (t) {
                        var e = this.renderer,
                        i = e.gl,
                        n = void 0,
                        r = t._webGL[this.CONTEXT_UID];
                        r && t.dirty === r.dirty || (this.updateGraphics(t), r = t._webGL[this.CONTEXT_UID]);
                        var s = this.primitiveShader;
                        e.bindShader(s),
                        e.state.setBlendMode(t.blendMode);
                        for (var a = 0, o = r.data.length; a < o; a++) {
                            var h = (n = r.data[a]).shader;
                            e.bindShader(h),
                            h.uniforms.translationMatrix = t.transform.worldTransform.toArray(!0),
                            h.uniforms.tint = pt(t.tint),
                            h.uniforms.alpha = t.worldAlpha,
                            e.bindVao(n.vao),
                            n.nativeLines ? i.drawArrays(i.LINES, 0, n.points.length / 6) : n.vao.draw(i.TRIANGLE_STRIP, n.indices.length)
                        }
                    }
                }, {
                    key: "updateGraphics",
                    value: function (t) {
                        var e = this.renderer.gl,
                        i = t._webGL[this.CONTEXT_UID];
                        if (i || (i = t._webGL[this.CONTEXT_UID] = {
                                    lastIndex: 0,
                                    data: [],
                                    gl: e,
                                    clearDirty: -1,
                                    dirty: -1
                                }), i.dirty = t.dirty, t.clearDirty !== i.clearDirty) {
                            i.clearDirty = t.clearDirty;
                            for (var n = 0; n < i.data.length; n++)
                                this.graphicsDataPool.push(i.data[n]);
                            i.data.length = 0,
                            i.lastIndex = 0
                        }
                        for (var r = void 0, s = void 0, a = i.lastIndex; a < t.graphicsData.length; a++) {
                            var o = t.graphicsData[a];
                            r = this.getWebGLData(i, 0),
                            o.nativeLines && o.lineWidth && (s = this.getWebGLData(i, 0, !0), i.lastIndex++),
                            o.type === Bt.POLY && sr(o, r, s),
                            o.type === Bt.RECT ? ar(o, r, s) : o.type === Bt.CIRC || o.type === Bt.ELIP ? lr(o, r, s) : o.type === Bt.RREC && or(o, r, s),
                            i.lastIndex++
                        }
                        this.renderer.bindVao(null);
                        for (var h = 0; h < i.data.length; h++)
                            (r = i.data[h]).dirty && r.upload()
                    }
                }, {
                    key: "getWebGLData",
                    value: function (t, e, i) {
                        var n = t.data[t.data.length - 1];
                        return (!n || n.nativeLines !== i || n.points.length > 32e4) && ((n = this.graphicsDataPool.pop() || new ir(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState)).nativeLines = i, n.reset(e), t.data.push(n)),
                        n.dirty = !0,
                        n
                    }
                }
            ]),
        e
    }
    ();
    En.registerPlugin("graphics", cr);
    var dr = function () {
        function t(e) {
            p(this, t),
            this.renderer = e
        }
        return g(t, [{
                    key: "render",
                    value: function (t) {
                        var e = this.renderer,
                        i = e.context,
                        n = t.worldAlpha,
                        r = t.transform.worldTransform,
                        s = e.resolution;
                        i.setTransform(r.a * s, r.b * s, r.c * s, r.d * s, r.tx * s, r.ty * s),
                        t.canvasTintDirty === t.dirty && t._prevTint === t.tint || this.updateGraphicsTint(t),
                        e.setBlendMode(t.blendMode);
                        for (var a = 0; a < t.graphicsData.length; a++) {
                            var o = t.graphicsData[a],
                            h = o.shape,
                            u = o._fillTint,
                            l = o._lineTint;
                            if (i.lineWidth = o.lineWidth, o.type === Bt.POLY) {
                                i.beginPath(),
                                this.renderPolygon(h.points, h.closed, i);
                                for (var c = 0; c < o.holes.length; c++)
                                    this.renderPolygon(o.holes[c].points, !0, i);
                                o.fill && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | u).toString(16)).substr(-6), i.fill()),
                                o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | l).toString(16)).substr(-6), i.stroke())
                            } else if (o.type === Bt.RECT)
                                (o.fillColor || 0 === o.fillColor) && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | u).toString(16)).substr(-6), i.fillRect(h.x, h.y, h.width, h.height)), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | l).toString(16)).substr(-6), i.strokeRect(h.x, h.y, h.width, h.height));
                            else if (o.type === Bt.CIRC)
                                i.beginPath(), i.arc(h.x, h.y, h.radius, 0, 2 * Math.PI), i.closePath(), o.fill && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | u).toString(16)).substr(-6), i.fill()), o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | l).toString(16)).substr(-6), i.stroke());
                            else if (o.type === Bt.ELIP) {
                                var d = 2 * h.width,
                                f = 2 * h.height,
                                v = h.x - d / 2,
                                p = h.y - f / 2;
                                i.beginPath();
                                var g = d / 2 * .5522848,
                                y = f / 2 * .5522848,
                                _ = v + d,
                                m = p + f,
                                x = v + d / 2,
                                T = p + f / 2;
                                i.moveTo(v, T),
                                i.bezierCurveTo(v, T - y, x - g, p, x, p),
                                i.bezierCurveTo(x + g, p, _, T - y, _, T),
                                i.bezierCurveTo(_, T + y, x + g, m, x, m),
                                i.bezierCurveTo(x - g, m, v, T + y, v, T),
                                i.closePath(),
                                o.fill && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | u).toString(16)).substr(-6), i.fill()),
                                o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | l).toString(16)).substr(-6), i.stroke())
                            } else if (o.type === Bt.RREC) {
                                var w = h.x,
                                b = h.y,
                                E = h.width,
                                k = h.height,
                                S = h.radius,
                                C = Math.min(E, k) / 2 | 0;
                                S = S > C ? C : S,
                                i.beginPath(),
                                i.moveTo(w, b + S),
                                i.lineTo(w, b + k - S),
                                i.quadraticCurveTo(w, b + k, w + S, b + k),
                                i.lineTo(w + E - S, b + k),
                                i.quadraticCurveTo(w + E, b + k, w + E, b + k - S),
                                i.lineTo(w + E, b + S),
                                i.quadraticCurveTo(w + E, b, w + E - S, b),
                                i.lineTo(w + S, b),
                                i.quadraticCurveTo(w, b, w, b + S),
                                i.closePath(),
                                (o.fillColor || 0 === o.fillColor) && (i.globalAlpha = o.fillAlpha * n, i.fillStyle = "#" + ("00000" + (0 | u).toString(16)).substr(-6), i.fill()),
                                o.lineWidth && (i.globalAlpha = o.lineAlpha * n, i.strokeStyle = "#" + ("00000" + (0 | l).toString(16)).substr(-6), i.stroke())
                            }
                        }
                    }
                }, {
                    key: "updateGraphicsTint",
                    value: function (t) {
                        t._prevTint = t.tint,
                        t.canvasTintDirty = t.dirty;
                        for (var e = (t.tint >> 16 & 255) / 255, i = (t.tint >> 8 & 255) / 255, n = (255 & t.tint) / 255, r = 0; r < t.graphicsData.length; ++r) {
                            var s = t.graphicsData[r],
                            a = 0 | s.fillColor,
                            o = 0 | s.lineColor;
                            s._fillTint = ((a >> 16 & 255) / 255 * e * 255 << 16) + ((a >> 8 & 255) / 255 * i * 255 << 8) + (255 & a) / 255 * n * 255,
                            s._lineTint = ((o >> 16 & 255) / 255 * e * 255 << 16) + ((o >> 8 & 255) / 255 * i * 255 << 8) + (255 & o) / 255 * n * 255
                        }
                    }
                }, {
                    key: "renderPolygon",
                    value: function (t, e, i) {
                        i.moveTo(t[0], t[1]);
                        for (var n = 1; n < t.length / 2; ++n)
                            i.lineTo(t[2 * n], t[2 * n + 1]);
                        e && i.closePath()
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.renderer = null
                    }
                }
            ]),
        t
    }
    ();
    Si.registerPlugin("graphics", dr);
    var fr = function () {
        function t(e, i) {
            var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null;
            p(this, t),
            this.baseTexture = e,
            this.textures = {},
            this.animations = {},
            this.data = i,
            this.resolution = this._updateResolution(n || this.baseTexture.imageUrl),
            this._frames = this.data.frames,
            this._frameKeys = Object.keys(this._frames),
            this._batchIndex = 0,
            this._callback = null
        }
        return g(t, null, [{
                    key: "BATCH_SIZE",
                    get: function () {
                        return 1e3
                    }
                }
            ]),
        g(t, [{
                    key: "_updateResolution",
                    value: function (t) {
                        var e = this.data.meta.scale,
                        i = Pt(t, null);
                        return null === i && (i = void 0 !== e ? parseFloat(e) : 1),
                        1 !== i && (this.baseTexture.resolution = i, this.baseTexture.update()),
                        i
                    }
                }, {
                    key: "parse",
                    value: function (e) {
                        this._batchIndex = 0,
                        this._callback = e,
                        this._frameKeys.length <= t.BATCH_SIZE ? (this._processFrames(0), this._processAnimations(), this._parseComplete()) : this._nextBatch()
                    }
                }, {
                    key: "_processFrames",
                    value: function (e) {
                        for (var i = e, n = t.BATCH_SIZE, r = this.baseTexture.sourceScale; i - e < n && i < this._frameKeys.length; ) {
                            var s = this._frameKeys[i],
                            a = this._frames[s],
                            o = a.frame;
                            if (o) {
                                var h = null,
                                u = null,
                                l = !1 !== a.trimmed && a.sourceSize ? a.sourceSize : a.frame,
                                c = new ee(0, 0, Math.floor(l.w * r) / this.resolution, Math.floor(l.h * r) / this.resolution);
                                h = a.rotated ? new ee(Math.floor(o.x * r) / this.resolution, Math.floor(o.y * r) / this.resolution, Math.floor(o.h * r) / this.resolution, Math.floor(o.w * r) / this.resolution) : new ee(Math.floor(o.x * r) / this.resolution, Math.floor(o.y * r) / this.resolution, Math.floor(o.w * r) / this.resolution, Math.floor(o.h * r) / this.resolution),
                                !1 !== a.trimmed && a.spriteSourceSize && (u = new ee(Math.floor(a.spriteSourceSize.x * r) / this.resolution, Math.floor(a.spriteSourceSize.y * r) / this.resolution, Math.floor(o.w * r) / this.resolution, Math.floor(o.h * r) / this.resolution)),
                                this.textures[s] = new yi(this.baseTexture, h, c, u, a.rotated ? 2 : 0, a.anchor),
                                yi.addToCache(this.textures[s], s)
                            }
                            i++
                        }
                    }
                }, {
                    key: "_processAnimations",
                    value: function () {
                        var t = this.data.animations || {};
                        for (var e in t) {
                            this.animations[e] = [];
                            var i = !0,
                            n = !1,
                            r = void 0;
                            try {
                                for (var s, a = t[e][Symbol.iterator](); !(i = (s = a.next()).done); i = !0) {
                                    var o = s.value;
                                    this.animations[e].push(this.textures[o])
                                }
                            } catch (t) {
                                n = !0,
                                r = t
                            }
                            finally {
                                try {
                                    !i && a.return && a.return()
                                }
                                finally {
                                    if (n)
                                        throw r
                                }
                            }
                        }
                    }
                }, {
                    key: "_parseComplete",
                    value: function () {
                        var t = this._callback;
                        this._callback = null,
                        this._batchIndex = 0,
                        t.call(this, this.textures)
                    }
                }, {
                    key: "_nextBatch",
                    value: function () {
                        var e = this;
                        this._processFrames(this._batchIndex * t.BATCH_SIZE),
                        this._batchIndex++,
                        setTimeout(function () {
                            e._batchIndex * t.BATCH_SIZE < e._frameKeys.length ? e._nextBatch() : (e._processAnimations(), e._parseComplete())
                        }, 0)
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                        for (var e in this.textures)
                            this.textures[e].destroy();
                        this._frames = null,
                        this._frameKeys = null,
                        this.data = null,
                        this.textures = null,
                        t && this.baseTexture.destroy(),
                        this.baseTexture = null
                    }
                }
            ]),
        t
    }
    (),
    vr = function () {
        function t(e) {
            p(this, t),
            this.container = new ui,
            e.addChild(this.container)
        }
        return g(t, [{
                    key: "bound",
                    value: function (t) {
                        var e = t.getBounds(),
                        i = e.x,
                        n = e.y,
                        r = e.width,
                        s = e.height,
                        a = t._debugBoundColor,
                        o = new er;
                        a || (a = Tt(), t._debugBoundColor = a),
                        o.lineStyle(1, a, .2),
                        o.beginFill(a, .1),
                        o.drawRect(i, n, r, s),
                        o.endFill(),
                        this.container.addChild(o)
                    }
                }, {
                    key: "recursiveCall",
                    value: function (t) {
                        var e = this;
                        t.children.forEach(function (t) {
                            0 === t.children.length ? e.bound(t) : e.recursiveCall(t)
                        })
                    }
                }, {
                    key: "render",
                    value: function (t) {
                        this.container.removeChildren(),
                        this.recursiveCall(t)
                    }
                }
            ]),
        t
    }
    (),
    pr = {
        defaultFPS: 0,
        actions: []
    },
    gr = function () {
        function t(e, i) {
            p(this, t),
            this.name = "",
            this.tween = null,
            this.duration = e,
            this.to = i,
            this.delay = 0,
            this.yoyo = !1,
            this.repeatTimes = 0,
            this.repeatDelayTime = 0,
            this.easing = w.Easing.Linear.None,
            this.interpolation = w.Interpolation.Linear,
            this._fps = 0
        }
        return g(t, [{
                    key: "create",
                    value: function () {
                        var t = this;
                        return function (e) {
                            var i = new w.Tween(e.getNature()).to(t.to, t.duration).repeat(t.repeatTimes).repeatDelay(t.repeatDelayTime).delay(t.delay).easing(t.easing).yoyo(t.yoyo).interpolation(t.interpolation).onStart(function () {
                                t._onTweenStart(),
                                t.onStart(this, e)
                            }).onUpdate(function () {
                                t.onUpdate(this, e)
                            }).onComplete(function () {
                                t._onTweenComplete(),
                                t.onComplete(this, e)
                            }).onStop(function () {
                                t.onStop(this, e)
                            });
                            return i.name = t.name,
                            t.tween = i,
                            i
                        }
                    }
                }, {
                    key: "setName",
                    value: function (t) {
                        this.name = t
                    }
                }, {
                    key: "onStart",
                    value: function (t, e) {
                        this._onStart(t, e)
                    }
                }, {
                    key: "onUpdate",
                    value: function (t, e) {
                        this._onUpdate(t, e)
                    }
                }, {
                    key: "onComplete",
                    value: function (t, e) {
                        this._onComplete(t, e)
                    }
                }, {
                    key: "onStop",
                    value: function (t, e) {
                        this._onStop(t, e)
                    }
                }, {
                    key: "_onStart",
                    value: function (t, e) {}
                }, {
                    key: "_onUpdate",
                    value: function (t, e) {}
                }, {
                    key: "_onComplete",
                    value: function (t, e) {}
                }, {
                    key: "_onStop",
                    value: function (t, e) {}
                }, {
                    key: "_onTweenStart",
                    value: function () {
                        pr.defaultFPS || (pr.defaultFPS = Lr.FPS),
                        this._fps && (pr.actions.push(this), pr.actions.length && (Lr.FPS = Math.max.apply(null, pr.actions.map(function (t) {
                                            return t._fps || 60
                                        }))))
                    }
                }, {
                    key: "_onTweenComplete",
                    value: function () {
                        if (this._fps && pr.actions.length) {
                            pr.actions = pr.actions.filter(function (t) {
                                return t.isPlaying()
                            });
                            var t = pr.actions.indexOf(this);
                            ~t && pr.actions.splice(t, 1),
                            pr.actions.length ? Lr.FPS = Math.max.apply(null, pr.actions.map(function (t) {
                                        return t._FPS || 60
                                    })) : Lr.FPS = pr.defaultFPS
                        }
                    }
                }, {
                    key: "setFPS",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 60;
                        this._fps = t
                    }
                }, {
                    key: "setEasing",
                    value: function (t) {
                        this.easing = t
                    }
                }, {
                    key: "setInterpolation",
                    value: function (t) {
                        this.interpolation = t
                    }
                }, {
                    key: "setDelay",
                    value: function (t) {
                        this.delay = t
                    }
                }, {
                    key: "setRepeatDelay",
                    value: function (t) {
                        this.repeatDelayTime = t
                    }
                }, {
                    key: "isPlaying",
                    value: function () {
                        return !!this.tween && this.tween.isPlaying()
                    }
                }, {
                    key: "stop",
                    value: function () {
                        this.tween && this.tween.stop()
                    }
                }, {
                    key: "pause",
                    value: function () {
                        this.tween && this.tween.pause()
                    }
                }, {
                    key: "resume",
                    value: function () {
                        this.tween && this.tween.resume()
                    }
                }
            ]),
        t
    }
    ();
    function yr(t, e) {
        var i = {};
        Object.assign(i, e);
        var n = new gr(t, i);
        return n._to = e,
        n._onStart = function (t, i) {
            n.to.x = i.x + e.x,
            n.to.y = i.y + e.y
        },
        n._onUpdate = function (t, e) {
            e.setPosition(t.x, t.y)
        },
        n._type = "MoveBy",
        n
    }
    function _r(t, e) {
        var i = new gr(t, e);
        return i._onUpdate = function (t, e) {
            e.setPosition(t.x, t.y)
        },
        i._type = "MoveTo",
        i
    }
    function mr(t, e) {
        var i = {};
        Object.assign(i, e);
        var n = new gr(t, i);
        return n._to = e,
        n._onStart = function (t, i) {
            n.to.scaleX = i.scale.x * e.scaleX,
            n.to.scaleY = i.scale.y * e.scaleY
        },
        n._onUpdate = function (t, e) {
            e.setScale(t.scaleX, t.scaleY)
        },
        n._type = "ScaleBy",
        n
    }
    function xr(t, e) {
        var i = new gr(t, e);
        return i._onUpdate = function (t, e) {
            e.setScale(t.scaleX, t.scaleY)
        },
        i._type = "ScaleTo",
        i
    }
    function Tr(t, e) {
        var i = {};
        Object.assign(i, e);
        var n = new gr(t, i);
        return n._to = e,
        n._onStart = function (t, i) {
            n.to.rotation = mt(xt(i.rotation) + xt(e.rotation))
        },
        n._onUpdate = function (t, e) {
            e.rotation = t.rotation
        },
        n._type = "RotateBy",
        n
    }
    function wr(t, e) {
        var i = new gr(t, e);
        return i._onUpdate = function (t, e) {
            e.rotation = t.rotation
        },
        i._type = "RotateTo",
        i
    }
    function br(t, e, i, n) {
        var r = {};
        Object.assign(r, e);
        for (var s = [], a = 0; a < 2 * n; a++)
            a % 2 == 0 ? s.push(r.y - i) : s.push(r.y);
        r.y = s;
        var o = new gr(t, r);
        return o._to = e,
        o.yoyo = !1,
        o.repeatTimes = 0,
        o._onUpdate = function (t, e) {
            e.setPosition(t.x, t.y)
        },
        o._type = "JumpTo",
        o._arg = [i, n],
        o
    }
    function Er(t, e) {
        for (var i = [], n = 0; n < t; n++)
            i.push(!1);
        for (var r = 0; r < e; r++)
            i.push(!0);
        var s = new gr(e + t, {
            visible: i
        });
        return s.yoyo = !1,
        s.repeatTimes = 0,
        s._onUpdate = function (t, e) {
            e.visible = ~~t.visible
        },
        s._type = "Blink",
        s._arg = [t, e],
        s
    }
    function kr(t, e) {
        var i = new gr(t, {
            alpha: e
        });
        return i._to = e,
        i.yoyo = !1,
        i.repeatTimes = 0,
        i._onUpdate = function (t, e) {
            e.setOpacity(t.alpha)
        },
        i._type = "FadeTo",
        i
    }
    function Sr(t) {
        return kr(t, 1)
    }
    function Cr(t) {
        return kr(t, 0)
    }
    function Or(t, e) {
        ut(e) && (e = _t(e));
        var i = {};
        Object.assign(i, e);
        var n = Pr(t, i);
        return n._to = e,
        n._onStart = function (t, i) {
            var r = pt(i.tint);
            n.to.colorR = 255 * r[0] + e.colorR,
            n.to.colorG = 255 * r[1] + e.colorG,
            n.to.colorB = 255 * r[2] + e.colorB,
            n.to.colorR <= 0 && (n.to.colorR = 0),
            n.to.colorG <= 0 && (n.to.colorG = 0),
            n.to.colorB <= 0 && (n.to.colorB = 0),
            n.to.colorR >= 255 && (n.to.colorR = 255),
            n.to.colorG >= 255 && (n.to.colorG = 255),
            n.to.colorB >= 255 && (n.to.colorB = 255)
        },
        n._type = "TintBy",
        n._arg = [t, e],
        n
    }
    function Pr(t, e) {
        ut(e) && (e = _t(e));
        var i = new gr(t, e);
        return i._onUpdate = function (t, e) {
            e.tint = yt([t.colorR / 255, t.colorG / 255, t.colorB / 255])
        },
        i._type = "TintTo",
        i._arg = [t, e],
        i
    }
    function Mr(t, e) {
        return Ar(1 / 0, t, e)
    }
    function Ar(t, e, i) {
        return !i && e.repeatDelayTime && (i = e.repeatDelayTime),
        e._type && -1 !== ["MoveBy", "ScaleBy", "RotateBy", "TintBy"].indexOf(e._type) ? (e._onComplete = function (n, r) {
            if (r.__tmp_times || (r.__tmp_times = 1), r.__tmp_times++, !(r.__tmp_times > t) && "runAction" === e._caller) {
                var s = void 0;
                switch (e._type) {
                case "MoveBy":
                    s = yr;
                    break;
                case "ScaleBy":
                    s = mr;
                    break;
                case "RotateBy":
                    s = Tr;
                    break;
                case "TintBy":
                    s = Or
                }
                if (!s)
                    return;
                var a = s(e.duration, Object.assign(Object.create(Object.prototype), e._to || e.to));
                a._onComplete = e._onComplete,
                i && a.setDelay(i),
                a.onStart = e.onStart,
                a.onUpdate = e.onUpdate,
                a.onComplete = e.onComplete,
                r.runAction(a)
            }
        }, e) : (e.repeatDelayTime = i, e.repeatTimes = t - 1, e._type = "Repeat", e)
    }
    function Ir(t) {
        return t.yoyo = !0,
        t.repeatTimes || (t.repeatTimes = 1),
        "Repeat" === t._type && (t.repeatTimes = 2 * (t.repeatTimes - 1) + 1),
        t._type = "Back",
        t
    }
    gr.cleanup = function (t) {
        t && 0 !== t.actions.length && (t.actions.forEach(function (t) {
                w.remove(t)
            }), t.actions = [])
    },
    gr.clone = function (t) {
        if (null === t || !dt(t))
            return t;
        var i = t._type,
        n = ct(t._to) ? t.to : t._to;
        dt(n) && (n = Object.assign(Object.create(Object.prototype), n));
        var r = void 0;
        switch (i) {
        case "Blink":
        case "TintBy":
        case "TintTo":
            r = e[i](t._arg[0], t._arg[1]);
            break;
        case "JumpTo":
            r = e[i](t.duration, n, t._arg[0], t._arg[1]);
            break;
        default:
            r = e[i](t.duration, n)
        }
        return r.setDelay(t.delay),
        r.setEasing(t.easing),
        r.setInterpolation(t.interpolation),
        r.setRepeatDelay(t.repeatDelayTime),
        r
    },
    ui.prototype.runAction = function (t) {
        for (var e = Array.isArray(t) ? t : arguments, i = 0; i < e.length; i++) {
            e[i]._caller = "runAction";
            var n = e[i].create()(this).start();
            this.actions.push(n)
        }
    },
    ui.prototype.runSequenceAction = function (t) {
        var e = Array.isArray(t) ? t : arguments,
        i = [];
        if (e.length > 0 && null == e[e.length - 1])
            throw new Error("parameters should not be ending with null");
        for (var n = 0; n < e.length; n++)
            i.push(e[n].create()(this));
        for (var r = i.length - 1; r > 0; r--)
            i[r - 1].chain(i[r]);
        i[0].start()
    };
    var Rr = function () {
        function t(e, i, n) {
            p(this, t),
            this.stage = e,
            this.scene = i,
            this.duration = n || 600
        }
        return g(t, [{
                    key: "Fade",
                    value: function (t) {
                        var e = this,
                        i = Cr(this.duration),
                        n = Sr(this.duration),
                        r = new er;
                        r.beginFill(t || 0),
                        r.drawRect(0, 0, Wt.width, Wt.height),
                        r.endFill(),
                        r.setOpacity(0),
                        e.stage.addChild(r),
                        n.onComplete = function () {
                            e.stage.removeChildren(),
                            e.stage.addChild(e.scene),
                            e.stage.addChild(r),
                            e.scene.emit("transitionend"),
                            r.runAction(i)
                        },
                        r.runAction(n)
                    }
                }, {
                    key: "FadeWhite",
                    value: function () {
                        this.Fade(16777215)
                    }
                }, {
                    key: "FadeColor",
                    value: function (t) {
                        this.Fade(t[0])
                    }
                }, {
                    key: "Progress",
                    value: function (t, e) {
                        var i = this;
                        i.stage.addChild(i.scene),
                        i.stage.addChild(e),
                        i.scene.mask = e,
                        t.onComplete = function () {
                            i.scene.mask = null,
                            i.stage.removeChildren(),
                            i.stage.addChild(i.scene),
                            i.scene.emit("transitionend")
                        },
                        e.runAction(t)
                    }
                }, {
                    key: "ProgressH",
                    value: function () {
                        var t = _r(this.duration, {
                            x: Wt.width
                        }),
                        e = new er;
                        e.beginFill(16777215),
                        e.drawRect(-Wt.width, 0, Wt.width, Wt.height),
                        e.endFill(),
                        this.Progress(t, e)
                    }
                }, {
                    key: "ProgressV",
                    value: function () {
                        var t = _r(this.duration, {
                            y: Wt.height
                        }),
                        e = new er;
                        e.beginFill(16777215),
                        e.drawRect(0, -Wt.height, Wt.width, Wt.height),
                        e.endFill(),
                        this.Progress(t, e)
                    }
                }, {
                    key: "ProgressInOut",
                    value: function () {
                        var t = xr(this.duration, At(Wt.width, Wt.height)),
                        e = new er;
                        e.beginFill(16777215),
                        e.drawRect(0, 0, 1, 1),
                        e.endFill(),
                        e.setPosition(Wt.width / 2, Wt.height / 2),
                        e.setPivot(.5),
                        this.Progress(t, e)
                    }
                }, {
                    key: "ProgressOutIn",
                    value: function () {
                        var t = this,
                        e = xr(this.duration, At(0)),
                        i = _r(this.duration, Mt(Wt.width / 2, Wt.height / 2)),
                        n = new er;
                        n.beginFill(16777215),
                        n.drawRect(0, 0, Wt.width, Wt.height),
                        n.endFill(),
                        n.setPivot(.5);
                        var r = new ui;
                        t.stage.children.forEach(function (t) {
                            r.addChild(t)
                        }),
                        r.mask = n,
                        t.stage.removeChildren(),
                        t.stage.addChild(t.scene),
                        t.stage.addChild(r),
                        t.stage.addChild(n),
                        t.scene.emit("transitionend"),
                        e.onComplete = function () {
                            r.mask = null,
                            t.stage.removeChild(r),
                            t.stage.removeChild(n)
                        },
                        n.runAction([e, i])
                    }
                }, {
                    key: "ProgressRadial",
                    value: function (t) {
                        var e = function (e, i, n, r) {
                            for (; r < 0; )
                                r += 360;
                            var s = function (e, i, n) {
                                var r = Math.PI * n / 180;
                                t && (r = -r);
                                var s = Math.cos(r),
                                a = Math.sin(r);
                                return new Yt(s * e - a * i, a * e + s * i)
                            }
                            (0, -2 * n, r %= 360),
                            a = 270,
                            o = 90,
                            h = [new Yt(e, i - 2 * n), new Yt(e, i), new Yt(e + s.x, i + s.y)];
                            return t && (a = 90, o = 270, h.reverse()),
                            r > a && h.push(new Yt(e - 2 * n, i)),
                            r > 180 && h.push(new Yt(e, i + 2 * n)),
                            r > o && h.push(new Yt(e + 2 * n, i)),
                            h
                        },
                        i = Wt.width / 2,
                        n = Wt.height / 2,
                        r = Math.max(Wt.width, Wt.height),
                        s = new er,
                        a = new gr(this.duration, {
                            angle: 360
                        });
                        a.yoyo = !1,
                        a.repeatTimes = 0,
                        a.onUpdate = function (t, a) {
                            !function (t) {
                                s.clear();
                                var a = e(i, n, r, t);
                                s.beginFill(16777215),
                                s.moveTo(a[0].x, a[0].y);
                                for (var o = 1; o < a.length; ++o)
                                    s.lineTo(a[o].x, a[o].y);
                                s.lineTo(a[0].x, a[0].y),
                                s.endFill()
                            }
                            (~~t.angle)
                        },
                        this.Progress(a, s)
                    }
                }, {
                    key: "ProgressRadialCW",
                    value: function () {
                        this.ProgressRadial(!1)
                    }
                }, {
                    key: "ProgressRadialCCW",
                    value: function () {
                        this.ProgressRadial(!0)
                    }
                }, {
                    key: "MoveIn",
                    value: function () {
                        var t = this,
                        e = _r(this.duration, new Yt);
                        t.stage.addChild(t.scene),
                        e.onComplete = function () {
                            t.stage.removeChildren(),
                            t.stage.addChild(t.scene),
                            t.scene.emit("transitionend")
                        },
                        t.scene.runAction(e)
                    }
                }, {
                    key: "MoveInL",
                    value: function () {
                        this.scene.setPositionX(-Wt.width),
                        this.MoveIn()
                    }
                }, {
                    key: "MoveInR",
                    value: function () {
                        this.scene.setPositionX(Wt.width),
                        this.MoveIn()
                    }
                }, {
                    key: "MoveInT",
                    value: function () {
                        this.scene.setPositionY(-Wt.height),
                        this.MoveIn()
                    }
                }, {
                    key: "MoveInB",
                    value: function () {
                        this.scene.setPositionY(Wt.height),
                        this.MoveIn()
                    }
                }, {
                    key: "SlideIn",
                    value: function (t, e) {
                        var i = this,
                        n = new ui;
                        i.stage.children.forEach(function (t) {
                            n.addChild(t)
                        }),
                        i.stage.removeChildren(),
                        n.addChild(i.scene),
                        i.scene.setPosition(t, e),
                        i.stage.addChild(n);
                        var r = _r(this.duration, {
                            x: -t,
                            y: -e
                        });
                        r.onComplete = function () {
                            i.stage.removeChildren(),
                            i.scene.setPosition(0),
                            i.stage.addChild(i.scene),
                            i.scene.emit("transitionend")
                        },
                        n.runAction(r)
                    }
                }, {
                    key: "SlideInL",
                    value: function () {
                        this.SlideIn(-Wt.width, 0)
                    }
                }, {
                    key: "SlideInR",
                    value: function () {
                        this.SlideIn(Wt.width, 0)
                    }
                }, {
                    key: "SlideInT",
                    value: function () {
                        this.SlideIn(0, -Wt.height)
                    }
                }, {
                    key: "SlideInB",
                    value: function () {
                        this.SlideIn(0, Wt.height)
                    }
                }
            ]),
        t
    }
    (),
    Dr = 0,
    Lr = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return i._fps = 0,
            i._paused = !0,
            i._updatePoll = {},
            i._tickerHandlers = [],
            i.ticker = ii,
            i.camera = new ui,
            i.stage = new ui,
            i.camera.addChild(i.stage),
            i.setup(Object.assign({}, Qe, t)),
            Je.showFPS && i._createStatsLabel(),
            Je.debug && (i.debug = new vr(i.camera)),
            i.renderer = i.autoDetectRenderer(Je.newWidth, Je.newHeight, {
                view: i.view
            }),
            Wt.width = Math.round(i.renderer.width),
            Wt.height = Math.round(i.renderer.height),
            Je.viewTouched && (i.view.style["touch-action"] = "initial", i.renderer.plugins.interaction.autoPreventDefault = !1),
            i
        }
        return m(e, f),
        g(e, [{
                    key: "render",
                    value: function () {
                        Je.debug && this.debug && this.debug.render(this.stage),
                        this.renderer && this.renderer.render(this.camera)
                    }
                }, {
                    key: "stop",
                    value: function () {
                        this.pause()
                    }
                }, {
                    key: "start",
                    value: function () {
                        this._paused && (this._paused = !1, ii.add(e._tweenUpdateFn), ii.start(), this._tickerHandlers.push(e._tweenUpdateFn))
                    }
                }, {
                    key: "resume",
                    value: function () {
                        if (this._paused) {
                            this._paused = !1;
                            try {
                                ii.start(),
                                Ye.forEach(function (t) {
                                    t.isManualPause() || t.start()
                                }),
                                Tiny.TWEEN.resume(),
                                Tiny.audio.manager.resume()
                            } catch (t) {}
                        }
                    }
                }, {
                    key: "pause",
                    value: function () {
                        if (!this._paused) {
                            this._paused = !0;
                            try {
                                ii.stop(),
                                Ye.forEach(function (t) {
                                    t.pause(!0)
                                }),
                                Tiny.TWEEN.pause(),
                                Tiny.audio.manager.pause()
                            } catch (t) {}
                        }
                    }
                }, {
                    key: "isPaused",
                    value: function () {
                        return this._paused
                    }
                }, {
                    key: "autoDetectRenderer",
                    value: function () {
                        var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 320,
                        e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 568,
                        i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
                        return Object.assign(i, Je.renderOptions),
                        Je.renderType !== Rt.CANVAS && je() ? new En(t, e, i) : new Si(t, e, i)
                    }
                }, {
                    key: "run",
                    value: function (t) {
                        this.replaceScene(t),
                        Je.autoRender ? this.mainLoop() : this.render()
                    }
                }, {
                    key: "replaceScene",
                    value: function (t, e, i) {
                        if (e) {
                            var n = new Rr(this.stage, t, i),
                            r = e;
                            Array.prototype.splice.call(arguments, 0, 3),
                            n[r](arguments)
                        } else
                            this.stage.removeChildren(), this.stage.addChild(t);
                        this._currentScene = t
                    }
                }, {
                    key: "mainLoop",
                    value: function () {
                        var t = function (t) {
                            for (var e in this.render(), this._updatePoll)
                                this._updatePoll.hasOwnProperty(e) && this._updatePoll[e].call(this, t)
                        };
                        ii.add(t, this);
                        var e = 0,
                        i = 0,
                        n = 0,
                        r = function (t) {
                            i++;
                            var r = window.performance.now();
                            if (r - e >= 1e3) {
                                var s = i;
                                this._fps = s,
                                this._label && (this._label.text = "SPF: " + (1 / s).toFixed(3) + "\nFPS: " + s.toFixed(1)),
                                i = 0,
                                e = r,
                                s > Qe.fps + 5 ? ++n >= 3 && this.emit("fps-overstep", s) : n = 0
                            }
                        };
                        ii.add(r, this),
                        this._tickerHandlers.push(t, r),
                        this.start()
                    }
                }, {
                    key: "onUpdate",
                    value: function (t) {
                        var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
                        i = t._tiny_update_key || (t._tiny_update_key = ++Dr);
                        this._updatePoll[i] && !e || (this._updatePoll[i] = t)
                    }
                }, {
                    key: "offUpdate",
                    value: function (t) {
                        var e = t._tiny_update_key;
                        e && delete this._updatePoll[e]
                    }
                }, {
                    key: "setup",
                    value: function (t) {
                        if (Object.assign(Je, t), !navigator.isCanvasPlus && ($.tablet || $.phone)) {
                            var e = document.createElement("style");
                            e.type = "text/css",
                            document.body.appendChild(e),
                            e.textContent = "body,canvas,div{ -moz-user-select: none;-webkit-user-select: none;-ms-user-select: none;-khtml-user-select: none;-webkit-tap-highlight-color:rgba(0,0,0,0);}"
                        }
                        var i = void 0;
                        Je.canvasId instanceof HTMLElement ? i = Je.canvasId : (i = document.getElementById(Je.canvasId)) || ((i = document.createElement("canvas")).setAttribute("tabindex", 99), i.id = Je.canvasId, i.style.outline = "none", document.body.appendChild(i)),
                        this.view = i,
                        this.resize()
                    }
                }, {
                    key: "resize",
                    value: function () {
                        var t = void 0,
                        e = Je.fixSize ? Je.height : window.innerHeight,
                        i = Je.fixSize ? Je.width : window.innerWidth,
                        n = Je.fixSize ? Je.width || i : Je.referWidth,
                        r = +Je.orientation ? e / n : i / n;
                        Je.width === i && Je.height === e && (r = 1);
                        var s = Je.width * r || i,
                        a = Je.height * r || e,
                        o = n * (+Je.orientation ? s / a : a / s);
                        if (+Je.orientation) {
                            var h = n;
                            n = o,
                            o = h
                        }
                        n *= Je.dpi,
                        o *= Je.dpi,
                        t = Math.min(a / o, s / n),
                        t = Number(t.toFixed(4)),
                        Je.renderOptions.resolution = Number((1 / t).toFixed(4)),
                        Je.renderOptions.autoResize = !0,
                        Je.newWidth = Math.round(n * t),
                        Je.newHeight = Math.round(o * t),
                        this.stage.setScale(t)
                    }
                }, {
                    key: "_createStatsLabel",
                    value: function () {
                        this._label = new qn("SPF: -\nFPS: -", {
                            fontSize: 18,
                            fontFamily: "Helvetica",
                            fill: "#ffffff",
                            stroke: "#666666",
                            strokeThickness: .2
                        }),
                        this._label.position.set(10, Je.newHeight - this._label.height - 10),
                        this.camera.addChild(this._label)
                    }
                }, {
                    key: "getCurrentScene",
                    value: function () {
                        return this._currentScene
                    }
                }, {
                    key: "getCurrentFPS",
                    value: function () {
                        return this._fps
                    }
                }, {
                    key: "destroy",
                    value: function (t, e) {
                        var i = this;
                        w.removeAll(),
                        this._tickerHandlers.forEach(function (t) {
                            i.ticker.remove(t, i)
                        }),
                        this.ticker.stop(),
                        this.stage.destroy(e),
                        this.stage = null,
                        this.camera.destroy(e),
                        this.camera = null,
                        this.renderer.destroy(t),
                        this.renderer = null
                    }
                }
            ], [{
                    key: "_tweenUpdateFn",
                    value: function () {
                        w.update()
                    }
                }, {
                    key: "FPS",
                    get: function () {
                        return Je.fps
                    },
                    set: function (t) {
                        Je.fps = t
                    }
                }
            ]),
        e
    }
    (),
    Fr = function () {
        function t() {
            p(this, t),
            this.global = new Yt,
            this.target = null,
            this.originalEvent = null,
            this.identifier = null,
            this.isPrimary = !1,
            this.button = 0,
            this.buttons = 0,
            this.width = 0,
            this.height = 0,
            this.tiltX = 0,
            this.tiltY = 0,
            this.pointerType = null,
            this.pressure = 0,
            this.rotationAngle = 0,
            this.twist = 0,
            this.tangentialPressure = 0
        }
        return g(t, [{
                    key: "getLocalPosition",
                    value: function (t, e, i) {
                        return t.worldTransform.applyInverse(i || this.global, e)
                    }
                }, {
                    key: "copyEvent",
                    value: function (t) {
                        t.isPrimary && (this.isPrimary = !0),
                        this.button = t.button,
                        this.buttons = Number.isInteger(t.buttons) ? t.buttons : t.which,
                        this.width = t.width,
                        this.height = t.height,
                        this.tiltX = t.tiltX,
                        this.tiltY = t.tiltY,
                        this.pointerType = t.pointerType,
                        this.pressure = t.pressure,
                        this.rotationAngle = t.rotationAngle,
                        this.twist = t.twist || 0,
                        this.tangentialPressure = t.tangentialPressure || 0
                    }
                }, {
                    key: "reset",
                    value: function () {
                        this.isPrimary = !1
                    }
                }, {
                    key: "pointerId",
                    get: function () {
                        return this.identifier
                    }
                }
            ]),
        t
    }
    (),
    Nr = function () {
        function t() {
            p(this, t),
            this.stopped = !1,
            this.target = null,
            this.currentTarget = null,
            this.type = null,
            this.data = null
        }
        return g(t, [{
                    key: "stopPropagation",
                    value: function () {
                        this.stopped = !0
                    }
                }, {
                    key: "reset",
                    value: function () {
                        this.stopped = !1,
                        this.currentTarget = null,
                        this.target = null
                    }
                }
            ]),
        t
    }
    (),
    Ur = function () {
        function t(e) {
            p(this, t),
            this._pointerId = e,
            this._flags = t.FLAGS.NONE
        }
        return g(t, [{
                    key: "_doSet",
                    value: function (t, e) {
                        this._flags = e ? this._flags | t : this._flags & ~t
                    }
                }, {
                    key: "pointerId",
                    get: function () {
                        return this._pointerId
                    }
                }, {
                    key: "flags",
                    get: function () {
                        return this._flags
                    },
                    set: function (t) {
                        this._flags = t
                    }
                }, {
                    key: "none",
                    get: function () {
                        return this._flags === this.constructor.FLAGS.NONE
                    }
                }, {
                    key: "over",
                    get: function () {
                        return 0 != (this._flags & this.constructor.FLAGS.OVER)
                    },
                    set: function (t) {
                        this._doSet(this.constructor.FLAGS.OVER, t)
                    }
                }, {
                    key: "rightDown",
                    get: function () {
                        return 0 != (this._flags & this.constructor.FLAGS.RIGHT_DOWN)
                    },
                    set: function (t) {
                        this._doSet(this.constructor.FLAGS.RIGHT_DOWN, t)
                    }
                }, {
                    key: "leftDown",
                    get: function () {
                        return 0 != (this._flags & this.constructor.FLAGS.LEFT_DOWN)
                    },
                    set: function (t) {
                        this._doSet(this.constructor.FLAGS.LEFT_DOWN, t)
                    }
                }
            ]),
        t
    }
    ();
    Ur.FLAGS = Object.freeze({
        NONE: 0,
        OVER: 1,
        LEFT_DOWN: 2,
        RIGHT_DOWN: 4
    });
    var Br = {
        interactive: !1,
        interactiveChildren: !0,
        hitArea: null,
        get buttonMode() {
            return "pointer" === this.cursor
        },
        set buttonMode(t) {
            t ? this.cursor = "pointer" : "pointer" === this.cursor && (this.cursor = null)
        },
        cursor: null,
        get trackedPointers() {
            return void 0 === this._trackedPointers && (this._trackedPointers = {}),
            this._trackedPointers
        },
        _trackedPointers: void 0
    };
    C(hi.prototype, Br);
    var Xr = 1,
    jr = {
        target: null,
        data: {
            global: null
        }
    },
    Gr = function (t) {
        function e(t, i) {
            p(this, e);
            var n = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this));
            return i = i || {},
            n.renderer = t,
            n.autoPreventDefault = void 0 === i.autoPreventDefault || i.autoPreventDefault,
            n.interactionFrequency = i.interactionFrequency || 10,
            n.mouse = new Fr,
            n.mouse.identifier = Xr,
            n.mouse.global.set(-999999),
            n.activeInteractionData = {},
            n.activeInteractionData[Xr] = n.mouse,
            n.interactionDataPool = [],
            n.eventData = new Nr,
            n.interactionDOMElement = null,
            n.moveWhenInside = !1,
            n.eventsAdded = !1,
            n.mouseOverRenderer = !1,
            n.supportsTouchEvents = "ontouchstart" in window,
            n.supportsPointerEvents = !!window.PointerEvent,
            n.onPointerUp = n.onPointerUp.bind(n),
            n.processPointerUp = n.processPointerUp.bind(n),
            n.onPointerCancel = n.onPointerCancel.bind(n),
            n.processPointerCancel = n.processPointerCancel.bind(n),
            n.onPointerDown = n.onPointerDown.bind(n),
            n.processPointerDown = n.processPointerDown.bind(n),
            n.onPointerMove = n.onPointerMove.bind(n),
            n.processPointerMove = n.processPointerMove.bind(n),
            n.onPointerOut = n.onPointerOut.bind(n),
            n.processPointerOverOut = n.processPointerOverOut.bind(n),
            n.onPointerOver = n.onPointerOver.bind(n),
            n.cursorStyles = {
            default:
                "inherit",
                pointer: "pointer"
            },
            n.currentCursorMode = null,
            n.cursor = null,
            n._tempPoint = new Yt,
            n.resolution = 1,
            n.setTargetElement(n.renderer.view, n.renderer.resolution),
            n
        }
        return m(e, f),
        g(e, [{
                    key: "hitTest",
                    value: function (t, e) {
                        return jr.target = null,
                        jr.data.global = t,
                        e || (e = this.renderer._lastObjectRendered),
                        this.processInteractive(jr, e, null, !0),
                        jr.target
                    }
                }, {
                    key: "setTargetElement",
                    value: function (t) {
                        var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
                        this.removeEvents(),
                        this.interactionDOMElement = t,
                        this.resolution = e,
                        this.addEvents()
                    }
                }, {
                    key: "addEvents",
                    value: function () {
                        this.interactionDOMElement && (ii.add(this.update, this, Gt.INTERACTION), window.navigator.msPointerEnabled ? (this.interactionDOMElement.style["-ms-content-zooming"] = "none", this.interactionDOMElement.style["-ms-touch-action"] = "none") : this.supportsPointerEvents && (this.interactionDOMElement.style["touch-action"] = "none"), this.supportsPointerEvents ? (window.document.addEventListener("pointermove", this.onPointerMove, !0), this.interactionDOMElement.addEventListener("pointerdown", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("pointerleave", this.onPointerOut, !0), this.interactionDOMElement.addEventListener("pointerover", this.onPointerOver, !0), window.addEventListener("pointercancel", this.onPointerCancel, !0), window.addEventListener("pointerup", this.onPointerUp, !0)) : (window.document.addEventListener("mousemove", this.onPointerMove, !0), this.interactionDOMElement.addEventListener("mousedown", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("mouseout", this.onPointerOut, !0), this.interactionDOMElement.addEventListener("mouseover", this.onPointerOver, !0), window.addEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.interactionDOMElement.addEventListener("touchstart", this.onPointerDown, !0), this.interactionDOMElement.addEventListener("touchcancel", this.onPointerCancel, !0), this.interactionDOMElement.addEventListener("touchend", this.onPointerUp, !0), this.interactionDOMElement.addEventListener("touchmove", this.onPointerMove, !0)), this.eventsAdded = !0)
                    }
                }, {
                    key: "removeEvents",
                    value: function () {
                        this.interactionDOMElement && (ii.remove(this.update, this), window.navigator.msPointerEnabled ? (this.interactionDOMElement.style["-ms-content-zooming"] = "", this.interactionDOMElement.style["-ms-touch-action"] = "") : this.supportsPointerEvents && (this.interactionDOMElement.style["touch-action"] = ""), this.supportsPointerEvents ? (window.document.removeEventListener("pointermove", this.onPointerMove, !0), this.interactionDOMElement.removeEventListener("pointerdown", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("pointerleave", this.onPointerOut, !0), this.interactionDOMElement.removeEventListener("pointerover", this.onPointerOver, !0), window.removeEventListener("pointercancel", this.onPointerCancel, !0), window.removeEventListener("pointerup", this.onPointerUp, !0)) : (window.document.removeEventListener("mousemove", this.onPointerMove, !0), this.interactionDOMElement.removeEventListener("mousedown", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("mouseout", this.onPointerOut, !0), this.interactionDOMElement.removeEventListener("mouseover", this.onPointerOver, !0), window.removeEventListener("mouseup", this.onPointerUp, !0)), this.supportsTouchEvents && (this.interactionDOMElement.removeEventListener("touchstart", this.onPointerDown, !0), this.interactionDOMElement.removeEventListener("touchcancel", this.onPointerCancel, !0), this.interactionDOMElement.removeEventListener("touchend", this.onPointerUp, !0), this.interactionDOMElement.removeEventListener("touchmove", this.onPointerMove, !0)), this.interactionDOMElement = null, this.eventsAdded = !1)
                    }
                }, {
                    key: "update",
                    value: function (t) {
                        if (this._deltaTime += t, !(this._deltaTime < this.interactionFrequency) && (this._deltaTime = 0, this.interactionDOMElement))
                            if (this.didMove)
                                this.didMove = !1;
                            else {
                                for (var e in this.cursor = null, this.activeInteractionData)
                                    if (this.activeInteractionData.hasOwnProperty(e)) {
                                        var i = this.activeInteractionData[e];
                                        if (i.originalEvent && "touch" !== i.pointerType) {
                                            var n = this.configureInteractionEventForDOMEvent(this.eventData, i.originalEvent, i);
                                            this.processInteractive(n, this.renderer._lastObjectRendered, this.processPointerOverOut, !0)
                                        }
                                    }
                                this.setCursorMode(this.cursor)
                            }
                    }
                }, {
                    key: "setCursorMode",
                    value: function (t) {
                        if (t = t || "default", this.currentCursorMode !== t) {
                            this.currentCursorMode = t;
                            var e = this.cursorStyles[t];
                            if (e)
                                switch (void 0 === e ? "undefined" : v(e)) {
                                case "string":
                                    this.interactionDOMElement.style.cursor = e;
                                    break;
                                case "function":
                                    e(t);
                                    break;
                                case "object":
                                    Object.assign(this.interactionDOMElement.style, e)
                                }
                            else
                                "string" != typeof t || Object.prototype.hasOwnProperty.call(this.cursorStyles, t) || (this.interactionDOMElement.style.cursor = t)
                        }
                    }
                }, {
                    key: "dispatchEvent",
                    value: function (t, e, i) {
                        i.stopped || (i.currentTarget = t, i.type = e, t.emit(e, i), t[e] && t[e](i))
                    }
                }, {
                    key: "mapPositionToPoint",
                    value: function (t, e, i) {
                        var n = void 0;
                        n = this.interactionDOMElement.parentElement ? this.interactionDOMElement.getBoundingClientRect() : {
                            x: 0,
                            y: 0,
                            width: 0,
                            height: 0
                        },
                        navigator.isCanvasPlus && (n = this.interactionDOMElement.getBoundingClientRect());
                        var r = 1 / this.resolution;
                        t.x = (e - n.left) * (this.interactionDOMElement.width / n.width) * r,
                        t.y = (i - n.top) * (this.interactionDOMElement.height / n.height) * r
                    }
                }, {
                    key: "processInteractive",
                    value: function (t, e, i, n, r) {
                        if (!e || !e.visible)
                            return !1;
                        var s = t.data.global,
                        a = !1,
                        o = r = e.interactive || r,
                        h = !0;
                        if (e.hitArea ? (n && (e.worldTransform.applyInverse(s, this._tempPoint), e.hitArea.contains(this._tempPoint.x, this._tempPoint.y) ? a = !0 : (n = !1, h = !1)), o = !1) : e._mask && n && (e._mask.containsPoint(s) || (n = !1, h = !1)), h && e.interactiveChildren && e.children)
                            for (var u = e.children, l = u.length - 1; l >= 0; l--) {
                                var c = u[l],
                                d = this.processInteractive(t, c, i, n, o);
                                if (d) {
                                    if (!c.parent)
                                        continue;
                                    o = !1,
                                    d && (t.target && (n = !1), a = !0)
                                }
                            }
                        return r && (n && !t.target && !e.hitArea && e.containsPoint && e.containsPoint(s) && 0 !== e.transform._worldID && (a = !0), e.interactive && (a && !t.target && (t.target = e), i && i(t, e, !!a))),
                        a
                    }
                }, {
                    key: "onPointerDown",
                    value: function (t) {
                        if (!this.supportsTouchEvents || "touch" !== t.pointerType) {
                            var e = this.normalizeToPointerData(t);
                            this.autoPreventDefault && e[0].isNormalized && t.preventDefault();
                            for (var i = e.length, n = 0; n < i; n++) {
                                var r = e[n],
                                s = this.getInteractionDataForPointerId(r),
                                a = this.configureInteractionEventForDOMEvent(this.eventData, r, s);
                                if (a.data.originalEvent = t, this.processInteractive(a, this.renderer._lastObjectRendered, this.processPointerDown, !0), this.emit("pointerdown", a), "touch" === r.pointerType)
                                    this.emit("touchstart", a);
                                else if ("mouse" === r.pointerType || "pen" === r.pointerType) {
                                    var o = 2 === r.button;
                                    this.emit(o ? "rightdown" : "mousedown", this.eventData)
                                }
                            }
                        }
                    }
                }, {
                    key: "processPointerDown",
                    value: function (t, e, i) {
                        var n = t.data,
                        r = t.data.identifier;
                        if (i)
                            if (e.trackedPointers[r] || (e.trackedPointers[r] = new Ur(r)), this.dispatchEvent(e, "pointerdown", t), "touch" === n.pointerType)
                                this.dispatchEvent(e, "touchstart", t);
                            else if ("mouse" === n.pointerType || "pen" === n.pointerType) {
                                var s = 2 === n.button;
                                s ? e.trackedPointers[r].rightDown = !0 : e.trackedPointers[r].leftDown = !0,
                                this.dispatchEvent(e, s ? "rightdown" : "mousedown", t)
                            }
                    }
                }, {
                    key: "onPointerComplete",
                    value: function (t, e, i) {
                        for (var n = this.normalizeToPointerData(t), r = n.length, s = t.target !== this.interactionDOMElement ? "outside" : "", a = 0; a < r; a++) {
                            var o = n[a],
                            h = this.getInteractionDataForPointerId(o),
                            u = this.configureInteractionEventForDOMEvent(this.eventData, o, h);
                            if (u.data.originalEvent = t, this.processInteractive(u, this.renderer._lastObjectRendered, i, e || !s), this.emit(e ? "pointercancel" : "pointerup" + s, u), "mouse" === o.pointerType || "pen" === o.pointerType) {
                                var l = 2 === o.button;
                                this.emit(l ? "rightup" + s : "mouseup" + s, u)
                            } else
                                "touch" === o.pointerType && (this.emit(e ? "touchcancel" : "touchend" + s, u), this.releaseInteractionDataForPointerId(o.pointerId, h))
                        }
                    }
                }, {
                    key: "onPointerCancel",
                    value: function (t) {
                        this.supportsTouchEvents && "touch" === t.pointerType || this.onPointerComplete(t, !0, this.processPointerCancel)
                    }
                }, {
                    key: "processPointerCancel",
                    value: function (t, e) {
                        var i = t.data,
                        n = t.data.identifier;
                        void 0 !== e.trackedPointers[n] && (delete e.trackedPointers[n], this.dispatchEvent(e, "pointercancel", t), "touch" === i.pointerType && this.dispatchEvent(e, "touchcancel", t))
                    }
                }, {
                    key: "onPointerUp",
                    value: function (t) {
                        this.supportsTouchEvents && "touch" === t.pointerType || this.onPointerComplete(t, !1, this.processPointerUp)
                    }
                }, {
                    key: "processPointerUp",
                    value: function (t, e, i) {
                        var n = t.data,
                        r = t.data.identifier,
                        s = e.trackedPointers[r],
                        a = "touch" === n.pointerType,
                        o = "mouse" === n.pointerType || "pen" === n.pointerType,
                        h = !1;
                        if (o) {
                            var u = 2 === n.button,
                            l = Ur.FLAGS,
                            c = u ? l.RIGHT_DOWN : l.LEFT_DOWN,
                            d = void 0 !== s && s.flags & c;
                            i ? (this.dispatchEvent(e, u ? "rightup" : "mouseup", t), d && (this.dispatchEvent(e, u ? "rightclick" : "click", t), h = !0)) : d && this.dispatchEvent(e, u ? "rightupoutside" : "mouseupoutside", t),
                            s && (u ? s.rightDown = !1 : s.leftDown = !1)
                        }
                        i ? (this.dispatchEvent(e, "pointerup", t), a && this.dispatchEvent(e, "touchend", t), s && (o && !h || this.dispatchEvent(e, "pointertap", t), a && (this.dispatchEvent(e, "tap", t), s.over = !1))) : s && (this.dispatchEvent(e, "pointerupoutside", t), a && this.dispatchEvent(e, "touchendoutside", t)),
                        s && s.none && delete e.trackedPointers[r]
                    }
                }, {
                    key: "onPointerMove",
                    value: function (t) {
                        if (!this.supportsTouchEvents || "touch" !== t.pointerType) {
                            var e = this.normalizeToPointerData(t);
                            "mouse" !== e[0].pointerType && "pen" !== e[0].pointerType || (this.didMove = !0, this.cursor = null);
                            for (var i = e.length, n = 0; n < i; n++) {
                                var r = e[n],
                                s = this.getInteractionDataForPointerId(r),
                                a = this.configureInteractionEventForDOMEvent(this.eventData, r, s);
                                a.data.originalEvent = t;
                                var o = "touch" !== r.pointerType || this.moveWhenInside;
                                this.processInteractive(a, this.renderer._lastObjectRendered, this.processPointerMove, o),
                                this.emit("pointermove", a),
                                "touch" === r.pointerType && this.emit("touchmove", a),
                                "mouse" !== r.pointerType && "pen" !== r.pointerType || this.emit("mousemove", a)
                            }
                            "mouse" === e[0].pointerType && this.setCursorMode(this.cursor)
                        }
                    }
                }, {
                    key: "processPointerMove",
                    value: function (t, e, i) {
                        var n = t.data,
                        r = "touch" === n.pointerType,
                        s = "mouse" === n.pointerType || "pen" === n.pointerType;
                        s && this.processPointerOverOut(t, e, i),
                        this.moveWhenInside && !i || (this.dispatchEvent(e, "pointermove", t), r && this.dispatchEvent(e, "touchmove", t), s && this.dispatchEvent(e, "mousemove", t))
                    }
                }, {
                    key: "onPointerOut",
                    value: function (t) {
                        if (!this.supportsTouchEvents || "touch" !== t.pointerType) {
                            var e = this.normalizeToPointerData(t)[0];
                            "mouse" === e.pointerType && (this.mouseOverRenderer = !1, this.setCursorMode(null));
                            var i = this.getInteractionDataForPointerId(e),
                            n = this.configureInteractionEventForDOMEvent(this.eventData, e, i);
                            n.data.originalEvent = e,
                            this.processInteractive(n, this.renderer._lastObjectRendered, this.processPointerOverOut, !1),
                            this.emit("pointerout", n),
                            "mouse" === e.pointerType || "pen" === e.pointerType ? this.emit("mouseout", n) : this.releaseInteractionDataForPointerId(i.identifier)
                        }
                    }
                }, {
                    key: "processPointerOverOut",
                    value: function (t, e, i) {
                        var n = t.data,
                        r = t.data.identifier,
                        s = "mouse" === n.pointerType || "pen" === n.pointerType,
                        a = e.trackedPointers[r];
                        i && !a && (a = e.trackedPointers[r] = new Ur(r)),
                        void 0 !== a && (i && this.mouseOverRenderer ? (a.over || (a.over = !0, this.dispatchEvent(e, "pointerover", t), s && this.dispatchEvent(e, "mouseover", t)), s && null === this.cursor && (this.cursor = e.cursor)) : a.over && (a.over = !1, this.dispatchEvent(e, "pointerout", this.eventData), s && this.dispatchEvent(e, "mouseout", t), a.none && delete e.trackedPointers[r]))
                    }
                }, {
                    key: "onPointerOver",
                    value: function (t) {
                        var e = this.normalizeToPointerData(t)[0],
                        i = this.getInteractionDataForPointerId(e),
                        n = this.configureInteractionEventForDOMEvent(this.eventData, e, i);
                        n.data.originalEvent = e,
                        "mouse" === e.pointerType && (this.mouseOverRenderer = !0),
                        this.emit("pointerover", n),
                        "mouse" !== e.pointerType && "pen" !== e.pointerType || this.emit("mouseover", n)
                    }
                }, {
                    key: "getInteractionDataForPointerId",
                    value: function (t) {
                        var e = t.pointerId,
                        i = void 0;
                        return e === Xr || "mouse" === t.pointerType ? i = this.mouse : this.activeInteractionData[e] ? i = this.activeInteractionData[e] : ((i = this.interactionDataPool.pop() || new Fr).identifier = e, this.activeInteractionData[e] = i),
                        i.copyEvent(t),
                        i
                    }
                }, {
                    key: "releaseInteractionDataForPointerId",
                    value: function (t) {
                        var e = this.activeInteractionData[t];
                        e && (delete this.activeInteractionData[t], e.reset(), this.interactionDataPool.push(e))
                    }
                }, {
                    key: "configureInteractionEventForDOMEvent",
                    value: function (t, e, i) {
                        return t.data = i,
                        this.mapPositionToPoint(i.global, e.clientX, e.clientY),
                        "touch" === e.pointerType && (e.globalX = i.global.x, e.globalY = i.global.y),
                        i.originalEvent = e,
                        t.reset(),
                        t
                    }
                }, {
                    key: "normalizeToPointerData",
                    value: function (t) {
                        var e = [];
                        if (this.supportsTouchEvents && (navigator.isCanvasPlus || window.TouchEvent && t instanceof window.TouchEvent))
                            for (var i = 0, n = t.changedTouches.length; i < n; i++) {
                                var r = t.changedTouches[i];
                                void 0 === r.button && (r.button = t.touches.length ? 1 : 0),
                                void 0 === r.buttons && (r.buttons = t.touches.length ? 1 : 0),
                                void 0 === r.isPrimary && (r.isPrimary = 1 === t.touches.length && "touchstart" === t.type),
                                void 0 === r.width && (r.width = r.radiusX || 1),
                                void 0 === r.height && (r.height = r.radiusY || 1),
                                void 0 === r.tiltX && (r.tiltX = 0),
                                void 0 === r.tiltY && (r.tiltY = 0),
                                void 0 === r.pointerType && (r.pointerType = "touch"),
                                void 0 === r.pointerId && (r.pointerId = r.identifier || 0),
                                void 0 === r.pressure && (r.pressure = r.force || .5),
                                r.twist = 0,
                                r.tangentialPressure = 0,
                                void 0 === r.layerX && (r.layerX = r.offsetX = r.clientX),
                                void 0 === r.layerY && (r.layerY = r.offsetY = r.clientY),
                                r.isNormalized = !0,
                                e.push(r)
                            }
                        else !(window.MouseEvent && t instanceof window.MouseEvent) || this.supportsPointerEvents && window.PointerEvent && t instanceof window.PointerEvent ? e.push(t) : (void 0 === t.isPrimary && (t.isPrimary = !0), void 0 === t.width && (t.width = 1), void 0 === t.height && (t.height = 1), void 0 === t.tiltX && (t.tiltX = 0), void 0 === t.tiltY && (t.tiltY = 0), void 0 === t.pointerType && (t.pointerType = "mouse"), void 0 === t.pointerId && (t.pointerId = Xr), void 0 === t.pressure && (t.pressure = .5), t.twist = 0, t.tangentialPressure = 0, t.isNormalized = !0, e.push(t));
                        return e
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.removeEvents(),
                        this.removeAllListeners(),
                        this.renderer = null,
                        this.mouse = null,
                        this.eventData = null,
                        this.interactionDOMElement = null,
                        this.onPointerDown = null,
                        this.processPointerDown = null,
                        this.onPointerUp = null,
                        this.processPointerUp = null,
                        this.onPointerCancel = null,
                        this.processPointerCancel = null,
                        this.onPointerMove = null,
                        this.processPointerMove = null,
                        this.onPointerOut = null,
                        this.processPointerOverOut = null,
                        this.onPointerOver = null,
                        this._tempPoint = null
                    }
                }
            ]),
        e
    }
    ();
    En.registerPlugin("interaction", Gr),
    Si.registerPlugin("interaction", Gr);
    var Wr = Object.freeze({
        InteractionData: Fr,
        InteractionManager: Gr,
        interactiveTarget: Br,
        InteractionTrackingData: Ur,
        InteractionEvent: Nr
    }),
    Yr = function (t) {
        return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t
    }
    (c(function (t, e) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            });
            var i = function () {
                function t(t, e) {
                    for (var i = 0; i < e.length; i++) {
                        var n = e[i];
                        n.enumerable = n.enumerable || !1,
                        n.configurable = !0,
                        "value" in n && (n.writable = !0),
                        Object.defineProperty(t, n.key, n)
                    }
                }
                return function (e, i, n) {
                    return i && t(e.prototype, i),
                    n && t(e, n),
                    e
                }
            }
            ();
            function n(t, e) {
                if (!(t instanceof e))
                    throw new TypeError("Cannot call a class as a function")
            }
            var r = function () {
                function t(e, i, r) {
                    void 0 === i && (i = !1),
                    n(this, t),
                    this._fn = e,
                    this._once = i,
                    this._thisArg = r,
                    this._next = this._prev = this._owner = null
                }
                return i(t, [{
                            key: "detach",
                            value: function () {
                                return null !== this._owner && (this._owner.detach(this), !0)
                            }
                        }
                    ]),
                t
            }
            ();
            function s(t, e) {
                return t._head ? (t._tail._next = e, e._prev = t._tail, t._tail = e) : (t._head = e, t._tail = e),
                e._owner = t,
                e
            }
            var a = function () {
                function t() {
                    n(this, t),
                    this._head = this._tail = void 0
                }
                return i(t, [{
                            key: "handlers",
                            value: function () {
                                var t = !(arguments.length <= 0 || void 0 === arguments[0]) && arguments[0],
                                e = this._head;
                                if (t)
                                    return !!e;
                                for (var i = []; e; )
                                    i.push(e), e = e._next;
                                return i
                            }
                        }, {
                            key: "has",
                            value: function (t) {
                                if (!(t instanceof r))
                                    throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");
                                return t._owner === this
                            }
                        }, {
                            key: "dispatch",
                            value: function () {
                                var t = this._head;
                                if (!t)
                                    return !1;
                                for (; t; )
                                    t._once && this.detach(t), t._fn.apply(t._thisArg, arguments), t = t._next;
                                return !0
                            }
                        }, {
                            key: "add",
                            value: function (t) {
                                var e = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
                                if ("function" != typeof t)
                                    throw new Error("MiniSignal#add(): First arg must be a Function.");
                                return s(this, new r(t, !1, e))
                            }
                        }, {
                            key: "once",
                            value: function (t) {
                                var e = arguments.length <= 1 || void 0 === arguments[1] ? null : arguments[1];
                                if ("function" != typeof t)
                                    throw new Error("MiniSignal#once(): First arg must be a Function.");
                                return s(this, new r(t, !0, e))
                            }
                        }, {
                            key: "detach",
                            value: function (t) {
                                if (!(t instanceof r))
                                    throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");
                                return t._owner !== this ? this : (t._prev && (t._prev._next = t._next), t._next && (t._next._prev = t._prev), t === this._head ? (this._head = t._next, null === t._next && (this._tail = null)) : t === this._tail && (this._tail = t._prev, this._tail._next = null), t._owner = null, this)
                            }
                        }, {
                            key: "detachAll",
                            value: function () {
                                var t = this._head;
                                if (!t)
                                    return this;
                                for (this._head = this._tail = null; t; )
                                    t._owner = null, t = t._next;
                                return this
                            }
                        }
                    ]),
                t
            }
            ();
            a.MiniSignalBinding = r,
            e.default = a,
            t.exports = e.default
        }));
    function Hr() {}
    function Vr(t, e, i, n) {
        var r = 0,
        s = t.length;
        !function a(o) {
            o || r === s ? i && i(o) : n ? setTimeout(function () {
                e(t[r++], a)
            }, 1) : e(t[r++], a)
        }
        ()
    }
    function zr(t) {
        return function () {
            if (null === t)
                throw new Error("Callback was already called.");
            var e = t;
            t = null,
            e.apply(this, arguments)
        }
    }
    function qr(t, e) {
        if (null == e)
            e = 1;
        else if (0 === e)
            throw new Error("Concurrency must not be zero");
        var i = 0,
        n = {
            _tasks: [],
            concurrency: e,
            saturated: Hr,
            unsaturated: Hr,
            buffer: e / 4,
            empty: Hr,
            drain: Hr,
            error: Hr,
            started: !1,
            paused: !1,
            push: function (t, e) {
                r(t, !1, e)
            },
            kill: function () {
                i = 0,
                n.drain = Hr,
                n.started = !1,
                n._tasks = []
            },
            unshift: function (t, e) {
                r(t, !0, e)
            },
            process: function () {
                for (; !n.paused && i < n.concurrency && n._tasks.length; ) {
                    var e = n._tasks.shift();
                    0 === n._tasks.length && n.empty(),
                    (i += 1) === n.concurrency && n.saturated(),
                    t(e.data, zr(s(e)))
                }
            },
            length: function () {
                return n._tasks.length
            },
            running: function () {
                return i
            },
            idle: function () {
                return n._tasks.length + i === 0
            },
            pause: function () {
                !0 !== n.paused && (n.paused = !0)
            },
            resume: function () {
                if (!1 !== n.paused) {
                    n.paused = !1;
                    for (var t = 1; t <= n.concurrency; t++)
                        n.process()
                }
            }
        };
        function r(t, e, i) {
            if (null != i && "function" != typeof i)
                throw new Error("task callback must be a function");
            if (n.started = !0, null == t && n.idle())
                setTimeout(function () {
                    return n.drain()
                }, 1);
            else {
                var r = {
                    data: t,
                    callback: "function" == typeof i ? i : Hr
                };
                e ? n._tasks.unshift(r) : n._tasks.push(r),
                setTimeout(function () {
                    return n.process()
                }, 1)
            }
        }
        function s(t) {
            return function () {
                i -= 1,
                t.callback.apply(t, arguments),
                null != arguments[0] && n.error(arguments[0], t.data),
                i <= n.concurrency - n.buffer && n.unsaturated(),
                n.idle() && n.drain(),
                n.process()
            }
        }
        return n
    }
    var Kr = Object.freeze({
        eachSeries: Vr,
        queue: qr
    });
    function Zr() {}
    var Jr = function () {
        function t(e, i, n) {
            if (p(this, t), "string" != typeof e || "string" != typeof i)
                throw new Error("Both name and url are required for constructing a resource.");
            n = n || {},
            this._flags = 0,
            this._setFlag(t.STATUS_FLAGS.DATA_URL, 0 === i.indexOf("data:")),
            this.name = e,
            this.url = i,
            this.extension = this._getExtension(),
            this.data = null,
            this.crossOrigin = !0 === n.crossOrigin ? "anonymous" : n.crossOrigin,
            this.timeout = n.timeout || 0,
            this.loadType = n.loadType || this._determineLoadType(),
            this.xhrType = n.xhrType,
            this.metadata = n.metadata || {},
            this.error = null,
            this.xhr = null,
            this.children = [],
            this.type = t.TYPE.UNKNOWN,
            this.progressChunk = 0,
            this._dequeue = Zr,
            this._onLoadBinding = null,
            this._elementTimer = 0,
            this._boundComplete = this.complete.bind(this),
            this._boundOnError = this._onError.bind(this),
            this._boundOnProgress = this._onProgress.bind(this),
            this._boundOnTimeout = this._onTimeout.bind(this),
            this._boundXhrOnError = this._xhrOnError.bind(this),
            this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this),
            this._boundXhrOnAbort = this._xhrOnAbort.bind(this),
            this._boundXhrOnLoad = this._xhrOnLoad.bind(this),
            this.onStart = new Yr,
            this.onProgress = new Yr,
            this.onComplete = new Yr,
            this.onAfterMiddleware = new Yr
        }
        return g(t, null, [{
                    key: "setExtensionLoadType",
                    value: function (e, i) {
                        Qr(t._loadTypeMap, e, i)
                    }
                }, {
                    key: "setExtensionXhrType",
                    value: function (e, i) {
                        Qr(t._xhrTypeMap, e, i)
                    }
                }
            ]),
        g(t, [{
                    key: "complete",
                    value: function () {
                        this._clearEvents(),
                        this._finish()
                    }
                }, {
                    key: "abort",
                    value: function (e) {
                        if (!this.error) {
                            if (this.error = new Error(e), this._clearEvents(), this.xhr)
                                this.xhr.abort();
                            else if (this.data)
                                if (this.data.src)
                                    this.data.src = t.EMPTY_GIF;
                                else
                                    for (; this.data.firstChild; )
                                        this.data.removeChild(this.data.firstChild);
                            this._finish()
                        }
                    }
                }, {
                    key: "load",
                    value: function (e) {
                        var i = this;
                        if (!this.isLoading)
                            if (this.isComplete)
                                e && setTimeout(function () {
                                    return e(i)
                                }, 1);
                            else
                                switch (e && this.onComplete.once(e), this._setFlag(t.STATUS_FLAGS.LOADING, !0), this.onStart.dispatch(this), !1 !== this.crossOrigin && "string" == typeof this.crossOrigin || (this.crossOrigin = D(this.url)), this.loadType) {
                                case t.LOAD_TYPE.IMAGE:
                                    this.type = t.TYPE.IMAGE,
                                    this._loadElement("image");
                                    break;
                                case t.LOAD_TYPE.AUDIO:
                                    this.type = t.TYPE.AUDIO,
                                    this._loadSourceElement("audio");
                                    break;
                                case t.LOAD_TYPE.VIDEO:
                                    this.type = t.TYPE.VIDEO,
                                    this._loadSourceElement("video");
                                    break;
                                case t.LOAD_TYPE.XHR:
                                default:
                                    this._loadXhr()
                                }
                    }
                }, {
                    key: "_hasFlag",
                    value: function (t) {
                        return 0 != (this._flags & t)
                    }
                }, {
                    key: "_setFlag",
                    value: function (t, e) {
                        this._flags = e ? this._flags | t : this._flags & ~t
                    }
                }, {
                    key: "_clearEvents",
                    value: function () {
                        clearTimeout(this._elementTimer),
                        this.data && this.data.removeEventListener && (this.data.removeEventListener("error", this._boundOnError, !1), this.data.removeEventListener("load", this._boundComplete, !1), this.data.removeEventListener("progress", this._boundOnProgress, !1), this.data.removeEventListener("canplaythrough", this._boundComplete, !1)),
                        this.xhr && (this.xhr.removeEventListener ? (this.xhr.removeEventListener("error", this._boundXhrOnError, !1), this.xhr.removeEventListener("timeout", this._boundXhrOnTimeout, !1), this.xhr.removeEventListener("abort", this._boundXhrOnAbort, !1), this.xhr.removeEventListener("progress", this._boundOnProgress, !1), this.xhr.removeEventListener("load", this._boundXhrOnLoad, !1)) : (this.xhr.onerror = null, this.xhr.ontimeout = null, this.xhr.onprogress = null, this.xhr.onload = null))
                    }
                }, {
                    key: "_finish",
                    value: function () {
                        if (this.isComplete)
                            throw new Error("Complete called again for an already completed resource.");
                        this._setFlag(t.STATUS_FLAGS.COMPLETE, !0),
                        this._setFlag(t.STATUS_FLAGS.LOADING, !1),
                        this.onComplete.dispatch(this)
                    }
                }, {
                    key: "_loadElement",
                    value: function (t) {
                        this.metadata.loadElement ? this.data = this.metadata.loadElement : "image" === t && void 0 !== window.Image ? this.data = new Image : this.data = document.createElement(t),
                        this.crossOrigin && (this.data.crossOrigin = this.crossOrigin),
                        this.metadata.skipSource || (this.data.src = this.url),
                        this.data.addEventListener("error", this._boundOnError, !1),
                        this.data.addEventListener("load", this._boundComplete, !1),
                        this.data.addEventListener("progress", this._boundOnProgress, !1),
                        this.timeout && (this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout))
                    }
                }, {
                    key: "_loadSourceElement",
                    value: function (t) {
                        if (this.metadata.loadElement ? this.data = this.metadata.loadElement : "audio" === t && void 0 !== window.Audio ? this.data = new Audio : this.data = document.createElement(t), null !== this.data) {
                            if (this.crossOrigin && (this.data.crossOrigin = this.crossOrigin), !this.metadata.skipSource)
                                if (navigator.isCanvasPlus)
                                    this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;
                                else if (Array.isArray(this.url))
                                    for (var e = this.metadata.mimeType, i = 0; i < this.url.length; ++i)
                                        this.data.appendChild(this._createSource(t, this.url[i], Array.isArray(e) ? e[i] : e));
                                else {
                                    var n = this.metadata.mimeType;
                                    this.data.appendChild(this._createSource(t, this.url, Array.isArray(n) ? n[0] : n))
                                }
                            this.data.addEventListener("error", this._boundOnError, !1),
                            this.data.addEventListener("load", this._boundComplete, !1),
                            this.data.addEventListener("progress", this._boundOnProgress, !1),
                            this.data.addEventListener("canplaythrough", this._boundComplete, !1),
                            this.data.load(),
                            this.timeout && (this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout))
                        } else
                            this.abort("Unsupported element: " + t)
                    }
                }, {
                    key: "_loadXhr",
                    value: function () {
                        "string" != typeof this.xhrType && (this.xhrType = this._determineXhrType());
                        var e = this.xhr = new XMLHttpRequest;
                        e.timeout = this.timeout,
                        e.open("GET", this.url, !0),
                        this.xhrType === t.XHR_RESPONSE_TYPE.JSON || this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT ? e.responseType = t.XHR_RESPONSE_TYPE.TEXT : e.responseType = this.xhrType,
                        e.addEventListener ? (e.addEventListener("error", this._boundXhrOnError, !1), e.addEventListener("timeout", this._boundXhrOnTimeout, !1), e.addEventListener("abort", this._boundXhrOnAbort, !1), e.addEventListener("progress", this._boundOnProgress, !1), e.addEventListener("load", this._boundXhrOnLoad, !1)) : (e.onerror = this._boundOnError, e.ontimeout = this._boundXhrOnTimeout, e.onabort = this._boundXhrOnAbort, e.onprogress = this._boundOnProgress, e.onload = this._boundXhrOnLoad),
                        e.send()
                    }
                }, {
                    key: "_createSource",
                    value: function (t, e, i) {
                        i || (i = t + "/" + this._getExtension(e));
                        var n = document.createElement("source");
                        return n.src = e,
                        n.type = i,
                        n
                    }
                }, {
                    key: "_onError",
                    value: function (t) {
                        this.abort("Failed to load element using: " + (t && t.target && t.target.nodeName))
                    }
                }, {
                    key: "_onProgress",
                    value: function (t) {
                        t && t.lengthComputable && this.onProgress.dispatch(this, t.loaded / t.total)
                    }
                }, {
                    key: "_onTimeout",
                    value: function () {
                        this.abort("Load timed out.")
                    }
                }, {
                    key: "_xhrOnError",
                    value: function () {
                        var t = this.xhr;
                        this.abort("[XMLHttpRequest] Request failed. Status: " + t.status + ', text: "' + t.statusText + '"')
                    }
                }, {
                    key: "_xhrOnTimeout",
                    value: function () {
                        this.abort("[XMLHttpRequest] Request timed out.")
                    }
                }, {
                    key: "_xhrOnAbort",
                    value: function () {
                        this.abort("[XMLHttpRequest] Request was aborted by the user.")
                    }
                }, {
                    key: "_xhrOnLoad",
                    value: function () {
                        var e = this.xhr,
                        i = "",
                        n = void 0 === e.status ? 200 : e.status;
                        if ("" !== e.responseType && "text" !== e.responseType && void 0 !== e.responseType || (i = e.responseText), 0 === n && (i.length > 0 || e.responseType === t.XHR_RESPONSE_TYPE.BUFFER) ? n = 200 : 1223 === n && (n = 204), 2 === (n / 100 | 0)) {
                            if (this.xhrType === t.XHR_RESPONSE_TYPE.TEXT)
                                this.data = i, this.type = t.TYPE.TEXT;
                            else if (this.xhrType === t.XHR_RESPONSE_TYPE.JSON)
                                try {
                                    this.data = JSON.parse(i),
                                    this.type = t.TYPE.JSON
                                } catch (t) {
                                    return void this.abort("Error trying to parse loaded json: " + t)
                                }
                            else if (this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT)
                                try {
                                    if (window.DOMParser) {
                                        var r = new DOMParser;
                                        this.data = r.parseFromString(i, "text/xml")
                                    } else {
                                        var s = document.createElement("div");
                                        s.innerHTML = i,
                                        this.data = s
                                    }
                                    this.type = t.TYPE.XML
                                } catch (t) {
                                    return void this.abort("Error trying to parse loaded xml: " + t)
                                }
                            else
                                this.data = e.response || i;
                            this.complete()
                        } else
                            this.abort("[" + e.status + "] " + e.statusText + ": " + e.responseURL)
                    }
                }, {
                    key: "_determineXhrType",
                    value: function () {
                        return t._xhrTypeMap[this.extension] || t.XHR_RESPONSE_TYPE.TEXT
                    }
                }, {
                    key: "_determineLoadType",
                    value: function () {
                        return t._loadTypeMap[this.extension] || t.LOAD_TYPE.XHR
                    }
                }, {
                    key: "_getExtension",
                    value: function () {
                        var t = this.url,
                        e = "";
                        if (this.isDataUrl) {
                            var i = t.indexOf("/");
                            e = t.substring(i + 1, t.indexOf(";", i)).toLowerCase()
                        } else
                            e = Ct(t);
                        return e
                    }
                }, {
                    key: "_getMimeFromXhrType",
                    value: function (e) {
                        switch (e) {
                        case t.XHR_RESPONSE_TYPE.BUFFER:
                            return "application/octet-binary";
                        case t.XHR_RESPONSE_TYPE.BLOB:
                            return "application/blob";
                        case t.XHR_RESPONSE_TYPE.DOCUMENT:
                            return "application/xml";
                        case t.XHR_RESPONSE_TYPE.JSON:
                            return "application/json";
                        case t.XHR_RESPONSE_TYPE.DEFAULT:
                        case t.XHR_RESPONSE_TYPE.TEXT:
                        default:
                            return "text/plain"
                        }
                    }
                }, {
                    key: "isDataUrl",
                    get: function () {
                        return this._hasFlag(t.STATUS_FLAGS.DATA_URL)
                    }
                }, {
                    key: "isComplete",
                    get: function () {
                        return this._hasFlag(t.STATUS_FLAGS.COMPLETE)
                    }
                }, {
                    key: "isLoading",
                    get: function () {
                        return this._hasFlag(t.STATUS_FLAGS.LOADING)
                    }
                }
            ]),
        t
    }
    ();
    function Qr(t, e, i) {
        e && 0 === e.indexOf(".") && (e = e.substring(1)),
        e && (t[e] = i)
    }
    Jr.STATUS_FLAGS = {
        NONE: 0,
        DATA_URL: 1,
        COMPLETE: 2,
        LOADING: 4
    },
    Jr.TYPE = {
        UNKNOWN: 0,
        JSON: 1,
        XML: 2,
        IMAGE: 3,
        AUDIO: 4,
        VIDEO: 5,
        TEXT: 6
    },
    Jr.LOAD_TYPE = {
        XHR: 1,
        IMAGE: 2,
        AUDIO: 3,
        VIDEO: 4
    },
    Jr.XHR_RESPONSE_TYPE = {
        DEFAULT: "text",
        BUFFER: "arraybuffer",
        BLOB: "blob",
        DOCUMENT: "document",
        JSON: "json",
        TEXT: "text"
    },
    Jr._loadTypeMap = {
        gif: Jr.LOAD_TYPE.IMAGE,
        png: Jr.LOAD_TYPE.IMAGE,
        bmp: Jr.LOAD_TYPE.IMAGE,
        jpg: Jr.LOAD_TYPE.IMAGE,
        jpeg: Jr.LOAD_TYPE.IMAGE,
        tif: Jr.LOAD_TYPE.IMAGE,
        tiff: Jr.LOAD_TYPE.IMAGE,
        webp: Jr.LOAD_TYPE.IMAGE,
        tga: Jr.LOAD_TYPE.IMAGE,
        svg: Jr.LOAD_TYPE.IMAGE,
        "svg+xml": Jr.LOAD_TYPE.IMAGE,
        mp3: Jr.LOAD_TYPE.AUDIO,
        ogg: Jr.LOAD_TYPE.AUDIO,
        wav: Jr.LOAD_TYPE.AUDIO,
        mp4: Jr.LOAD_TYPE.VIDEO,
        webm: Jr.LOAD_TYPE.VIDEO
    },
    Jr._xhrTypeMap = {
        xhtml: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        html: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        htm: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        xml: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        tmx: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        svg: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        tsx: Jr.XHR_RESPONSE_TYPE.DOCUMENT,
        gif: Jr.XHR_RESPONSE_TYPE.BLOB,
        png: Jr.XHR_RESPONSE_TYPE.BLOB,
        bmp: Jr.XHR_RESPONSE_TYPE.BLOB,
        jpg: Jr.XHR_RESPONSE_TYPE.BLOB,
        jpeg: Jr.XHR_RESPONSE_TYPE.BLOB,
        tif: Jr.XHR_RESPONSE_TYPE.BLOB,
        tiff: Jr.XHR_RESPONSE_TYPE.BLOB,
        webp: Jr.XHR_RESPONSE_TYPE.BLOB,
        tga: Jr.XHR_RESPONSE_TYPE.BLOB,
        json: Jr.XHR_RESPONSE_TYPE.JSON,
        text: Jr.XHR_RESPONSE_TYPE.TEXT,
        txt: Jr.XHR_RESPONSE_TYPE.TEXT,
        ttf: Jr.XHR_RESPONSE_TYPE.BUFFER,
        otf: Jr.XHR_RESPONSE_TYPE.BUFFER
    },
    Jr.EMPTY_GIF = "";
    var $r = /(#[\w-]+)?$/,
    ts = M,
    es = function () {
        function t() {
            var e = this,
            i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
            n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 10;
            p(this, t),
            this.baseUrl = i,
            this.progress = 0,
            this.loading = !1,
            this.defaultQueryString = "",
            this._beforeMiddleware = [],
            this._afterMiddleware = [],
            this._resourcesParsing = [],
            this._boundLoadResource = function (t, i) {
                return e._loadResource(t, i)
            },
            this._queue = qr(this._boundLoadResource, n),
            this._queue.pause(),
            this.resources = {},
            this.onProgress = new Yr,
            this.onError = new Yr,
            this.onLoad = new Yr,
            this.onStart = new Yr,
            this.onComplete = new Yr;
            for (var r = 0; r < t._defaultBeforeMiddleware.length; ++r)
                this.pre(t._defaultBeforeMiddleware[r]);
            for (var s = 0; s < t._defaultAfterMiddleware.length; ++s)
                this.use(t._defaultAfterMiddleware[s])
        }
        return g(t, [{
                    key: "add",
                    value: function (t, e, i, n) {
                        if (Array.isArray(t)) {
                            for (var r = 0; r < t.length; ++r)
                                this.add(t[r]);
                            return this
                        }
                        if ("object" === (void 0 === t ? "undefined" : v(t)) && (n = e || t.callback || t.onComplete, i = t, e = t.url, t = t.name || t.key || t.url), "string" != typeof e && (n = i, i = e, e = t), "string" != typeof e)
                            throw new Error("No url passed to add resource to loader.");
                        if ("function" == typeof i && (n = i, i = null), this.loading && (!i || !i.parentResource))
                            throw new Error("Cannot add resources while the loader is running.");
                        if (this.resources[t])
                            throw new Error('Resource named "' + t + '" already exists.');
                        if (e = this._prepareUrl(e), this.resources[t] = new Jr(t, e, i), "function" == typeof n && this.resources[t].onAfterMiddleware.once(n), this.loading) {
                            for (var s = i.parentResource, a = [], o = 0; o < s.children.length; ++o)
                                s.children[o].isComplete || a.push(s.children[o]);
                            var h = s.progressChunk * (a.length + 1) / (a.length + 2);
                            s.children.push(this.resources[t]),
                            s.progressChunk = h;
                            for (var u = 0; u < a.length; ++u)
                                a[u].progressChunk = h;
                            this.resources[t].progressChunk = h
                        }
                        return this._queue.push(this.resources[t]),
                        this
                    }
                }, {
                    key: "pre",
                    value: function (t) {
                        return this._beforeMiddleware.push(t),
                        this
                    }
                }, {
                    key: "use",
                    value: function (t) {
                        return this._afterMiddleware.push(t),
                        this
                    }
                }, {
                    key: "reset",
                    value: function () {
                        for (var t in this.progress = 0, this.loading = !1, this._queue.kill(), this._queue.pause(), this.resources) {
                            var e = this.resources[t];
                            e._onLoadBinding && e._onLoadBinding.detach(),
                            e.isLoading && e.abort()
                        }
                        return this.resources = {},
                        this
                    }
                }, {
                    key: "load",
                    value: function (t) {
                        if ("function" == typeof t && this.onComplete.once(t), this.loading)
                            return this;
                        if (this._queue.idle())
                            this._onStart(), this._onComplete();
                        else {
                            for (var e = 100 / this._queue._tasks.length, i = 0; i < this._queue._tasks.length; ++i)
                                this._queue._tasks[i].data.progressChunk = e;
                            this._onStart(),
                            this._queue.resume()
                        }
                        return this
                    }
                }, {
                    key: "_prepareUrl",
                    value: function (t) {
                        var e = ts(t, {
                            strictMode: !0
                        }),
                        i = void 0;
                        if (i = e.protocol || !e.path || 0 === t.indexOf("//") ? t : this.baseUrl.length && this.baseUrl.lastIndexOf("/") !== this.baseUrl.length - 1 && "/" !== t.charAt(0) ? this.baseUrl + "/" + t : this.baseUrl + t, this.defaultQueryString) {
                            var n = $r.exec(i)[0];
                            -1 !== (i = i.substr(0, i.length - n.length)).indexOf("?") ? i += "&" + this.defaultQueryString : i += "?" + this.defaultQueryString,
                            i += n
                        }
                        return i
                    }
                }, {
                    key: "_loadResource",
                    value: function (t, e) {
                        var i = this;
                        t._dequeue = e,
                        Vr(this._beforeMiddleware, function (e, n) {
                            e.call(i, t, function () {
                                n(t.isComplete ? {}
                                     : null)
                            })
                        }, function () {
                            t.isComplete ? i._onLoad(t) : (t._onLoadBinding = t.onComplete.once(i._onLoad, i), t.load())
                        }, !0)
                    }
                }, {
                    key: "_onStart",
                    value: function () {
                        this.progress = 0,
                        this.loading = !0,
                        this.onStart.dispatch(this)
                    }
                }, {
                    key: "_onComplete",
                    value: function () {
                        this.progress = 100,
                        this.loading = !1,
                        this.onComplete.dispatch(this, this.resources)
                    }
                }, {
                    key: "_onLoad",
                    value: function (t) {
                        var e = this;
                        t._onLoadBinding = null,
                        this._resourcesParsing.push(t),
                        t._dequeue(),
                        Vr(this._afterMiddleware, function (i, n) {
                            i.call(e, t, n)
                        }, function () {
                            t.onAfterMiddleware.dispatch(t),
                            e.progress = Math.min(100, e.progress + t.progressChunk),
                            e.onProgress.dispatch(e, t),
                            t.error ? e.onError.dispatch(t.error, e, t) : e.onLoad.dispatch(e, t),
                            e._resourcesParsing.splice(e._resourcesParsing.indexOf(t), 1),
                            e._queue.idle() && 0 === e._resourcesParsing.length && e._onComplete()
                        }, !0)
                    }
                }, {
                    key: "concurrency",
                    get: function () {
                        return this._queue.concurrency
                    },
                    set: function (t) {
                        this._queue.concurrency = t
                    }
                }
            ]),
        t
    }
    ();
    function is() {
        return function (t, e) {
            t.data && t.type === Jr.TYPE.IMAGE && (t.texture = yi.fromLoader(t.data, t.url, t.name)),
            e()
        }
    }
    function ns() {
        return function (t, e) {
            var i = t.name + "_image";
            if (t.data && t.type === Jr.TYPE.JSON && t.data.frames && !this.resources[i]) {
                var n = {
                    crossOrigin: t.crossOrigin,
                    metadata: t.metadata.imageMetadata,
                    parentResource: t
                },
                r = rs(t, this.baseUrl);
                this.add(i, r, n, function (i) {
                    if (i.error)
                        return console.warn(i.error), ht(t.metadata.fallback) && t.metadata.fallback(i), void e(i.error);
                    var n = new fr(i.texture.baseTexture, t.data, t.url);
                    n.parse(function () {
                        t.spritesheet = n,
                        t.textures = n.textures,
                        e()
                    })
                })
            } else
                e()
        }
    }
    function rs(t, e) {
        if (t.isDataUrl)
            return t.data.meta.image;
        var i = t.data.meta.image;
        return t.metadata.image && (i = t.metadata.image),
        A(t.url.replace(e, ""), i)
    }
    es._defaultBeforeMiddleware = [],
    es._defaultAfterMiddleware = [],
    es.pre = function (t) {
        return es._defaultBeforeMiddleware.push(t),
        es
    },
    es.use = function (t) {
        return es._defaultAfterMiddleware.push(t),
        es
    },
    es.Resource = Jr,
    es.async = Kr;
    var ss = function (t) {
        function e(t, i) {
            p(this, e);
            var n = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t, i));
            f.call(n);
            for (var r = 0; r < e._tinyPreMiddleware.length; ++r)
                n.pre(e._tinyPreMiddleware[r]());
            for (var s = 0; s < e._tinyMiddleware.length; ++s)
                n.use(e._tinyMiddleware[s]());
            return n.onStart.add(function (t) {
                return n.emit("start", t)
            }),
            n.onProgress.add(function (t, e) {
                return n.emit("progress", t, e)
            }),
            n.onError.add(function (t, e, i) {
                return n.emit("error", t, e, i)
            }),
            n.onLoad.add(function (t, e) {
                return n.emit("load", t, e)
            }),
            n.onComplete.add(function (t, e) {
                return n.emit("complete", t, e)
            }),
            n
        }
        return m(e, es),
        g(e, [{
                    key: "add",
                    value: function (t, i, n, r) {
                        return dt(t) ? rt.test(t.url) && (t.crossOrigin = !1) : lt(t) && (rt.test(t) || rt.test(i)) && (dt(i) && (i.crossOrigin = !1), dt(n) && (n.crossOrigin = !1)),
                        _(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "add", this).call(this, t, i, n, r),
                        this
                    }
                }, {
                    key: "run",
                    value: function (t) {
                        t || (t = {});
                        var e = t.resources;
                        if (!Array.isArray(e))
                            throw new Error("The param [resources] must be array");
                        this.add(e);
                        this.on("load", function (e, i) {
                            (t.onComplete || function () {})(e, i)
                        }),
                        this.on("error", function (e, i, n) {
                            var r = e + ", url: " + n.url;
                            (t.onError || function () {
                                throw r
                            })(r, i, n)
                        }),
                        this.on("complete", function (e, i) {
                            (t.onAllComplete || function () {})(e, i)
                        }),
                        this.on("progress", function (e, i) {
                            (t.onProgress || function () {})(Number(e.progress.toFixed(2)), i)
                        }),
                        this.load()
                    }
                }, {
                    key: "destroy",
                    value: function () {
                        this.removeAllListeners(),
                        this.reset()
                    }
                }
            ], [{
                    key: "addTinyMiddleware",
                    value: function (t) {
                        e._tinyMiddleware.push(t)
                    }
                }, {
                    key: "addTinyPreMiddleware",
                    value: function (t) {
                        e._tinyPreMiddleware.push(t)
                    }
                }
            ]),
        e
    }
    ();
    for (var as in f.prototype)
        ss.prototype[as] = f.prototype[as];
    ss._tinyMiddleware = [is, ns],
    ss._tinyPreMiddleware = [function () {
            return function (t, e) {
                if (t.xhrType === Jr.XHR_RESPONSE_TYPE.JSONOBJECT) {
                    var i = y({}, t.metadata);
                    t.type = Jr.TYPE.JSON,
                    t.data = t.metadata.JSONObject,
                    delete i.JSONObject,
                    t.metadata.imageMetadata = i,
                    t.complete()
                }
                e()
            }
        }
    ];
    var os = es.Resource;
    os.setExtensionXhrType("fnt", os.XHR_RESPONSE_TYPE.DOCUMENT),
    os.XHR_RESPONSE_TYPE.JSONOBJECT = "JSONObject";
    var hs = function () {
        function t(e) {
            p(this, t),
            this._url = e
        }
        return g(t, [{
                    key: "load",
                    value: function (t) {
                        t || (t = {});
                        var e = this,
                        i = bt();
                        i.open("GET", e._url, !0),
                        i.overrideMimeType && i.overrideMimeType("ext/plain; charset=x-user-defined"),
                        i.onload = function () {
                            var n,
                            r;
                            4 == +i.readyState && 200 == +i.status ? (n = e._str2Uint8Array(i.responseText), (t.onComplete || function () {})(n, r)) : function (e, i, n) {
                                var r = e + ", url: " + n.url;
                                (t.onError || function () {
                                    throw r
                                })(r, i, n)
                            }
                            ()
                        },
                        i.send(null)
                    }
                }, {
                    key: "_str2Uint8Array",
                    value: function (t) {
                        if (!t)
                            return null;
                        for (var e = new Uint8Array(t.length), i = 0; i < t.length; i++)
                            e[i] = 255 & t.charCodeAt(i);
                        return e
                    }
                }
            ]),
        t
    }
    (),
    us = Object.freeze({
        Loader: ss,
        BinaryLoader: hs,
        spritesheetParser: ns,
        getResourcePath: rs,
        textureParser: is,
        Resource: Jr
    });
    function ls(t, e) {
        var i = ["", "WEBKIT_"],
        n = null;
        for (var r in i)
            if (n = t.getExtension(i[r] + e))
                break;
        return n
    }
    var cs = function (t) {
        function e(t) {
            p(this, e);
            var i = x(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t));
            return i.extensions = {},
            i
        }
        return m(e, Ci),
        g(e, [{
                    key: "onContextChange",
                    value: function () {
                        var t = this.renderer.gl;
                        this.extensions = {
                            pvrtc: ls(t, "WEBGL_compressed_texture_pvrtc"),
                            astc: ls(t, "WEBGL_compressed_texture_astc")
                        }
                    }
                }, {
                    key: "getSupportedExtensions",
                    value: function () {
                        return this.extensions
                    }
                }
            ]),
        e
    }
    (),
    ds = 33776,
    fs = 33778,
    vs = 33779,
    ps = 35986,
    gs = 35987,
    ys = 34798,
    _s = 37808,
    ms = 37809,
    xs = 37810,
    Ts = 37811,
    ws = 37812,
    bs = 37813,
    Es = 37814,
    ks = 37815,
    Ss = 37816,
    Cs = 37817,
    Os = 37818,
    Ps = 37819,
    Ms = 37820,
    As = 37821,
    Is = 37840,
    Rs = 37841,
    Ds = 37842,
    Ls = 37843,
    Fs = 37844,
    Ns = 37845,
    Us = 37846,
    Bs = 37847,
    Xs = 37848,
    js = 37849,
    Gs = 37850,
    Ws = 37851,
    Ys = 37852,
    Hs = 37853,
    Vs = 35840,
    zs = 35841,
    qs = 35842,
    Ks = 35843,
    Zs = 36196,
    Js = function () {
        function t(e, i, n, r, s, a, o) {
            p(this, t),
            this.init.apply(this, arguments)
        }
        return g(t, [{
                    key: "init",
                    value: function (t, e, i, n, r, s, a) {
                        this.src = t,
                        this.width = n,
                        this.height = r,
                        this.data = e,
                        this.type = i,
                        this.levels = s,
                        this.internalFormat = a,
                        this.isCompressedImage = !0,
                        this.preserveSource = !0;
                        var o = this.complete;
                        return this.complete = !!e,
                        !o && this.complete && this.onload && this.onload({
                            target: this
                        }),
                        this
                    }
                }, {
                    key: "loadFromArrayBuffer",
                    value: function (t) {
                        if (function (t) {
                            return !(171 !== t[0] || 75 !== t[1] || 84 !== t[2] || 88 !== t[3] || 32 !== t[4] || 49 !== t[5] || 49 !== t[6] || 187 !== t[7] || 13 !== t[8] || 10 !== t[9] || 26 !== t[10] || 10 !== t[11])
                        }
                            (new Uint8Array(t, 0, 12)))
                            return this._loadKTX(t);
                        throw new Error("Compressed texture format is not recognized: " + this.src)
                    }
                }, {
                    key: "generateWebGLTexture",
                    value: function (t) {
                        if (null === this.data)
                            throw new Error("Trying to create a second (or more) webgl texture from the same CompressedImage : " + this.src);
                        for (var e = this.levels, i = this.width, n = this.height, r = 0, s = 0; s < this.levels; ++s) {
                            var a = Qs(this.internalFormat, i, n),
                            o = new Uint8Array(this.data.buffer, this.data.byteOffset + r, a);
                            t.compressedTexImage2D(t.TEXTURE_2D, s, this.internalFormat, i, n, 0, o),
                            (i >>= 1) < 1 && (i = 1),
                            (n >>= 1) < 1 && (n = 1),
                            r += a
                        }
                        e > 1 ? (t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR_MIPMAP_NEAREST)) : (t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR)),
                        this.preserveSource || (this.data = null)
                    }
                }, {
                    key: "_loadKTX",
                    value: function (t) {
                        var e = Uint32Array.BYTES_PER_ELEMENT,
                        i = new DataView(t, 12, 13 * e),
                        n = 67305985 === i.getUint32(0, !0),
                        r = i.getUint32(4 * e, n),
                        s = i.getUint32(6 * e, n),
                        a = i.getUint32(7 * e, n),
                        o = i.getUint32(11 * e, n),
                        h = 64 + i.getUint32(12 * e, n),
                        u = new Int32Array(t, h, 1)[0],
                        l = new Uint8Array(t, h + 4, u);
                        return this.init(this.src, l, "KTX", s, a, o, r)
                    }
                }, {
                    key: "dispose",
                    value: function () {
                        this.data = null
                    }
                }
            ], [{
                    key: "loadFromArrayBuffer",
                    value: function (e) {
                        return (new t).loadFromArrayBuffer(e)
                    }
                }
            ]),
        t
    }
    ();
    function Qs(t, e, i) {
        switch (t) {
        case ds:
        case ps:
        case Zs:
            return (e + 3 >> 2) * (i + 3 >> 2) * 8;
        case fs:
        case vs:
        case gs:
        case ys:
            return (e + 3 >> 2) * (i + 3 >> 2) * 16;
        case Vs:
        case qs:
            return Math.floor((Math.max(e, 8) * Math.max(i, 8) * 4 + 7) / 8);
        case zs:
        case Ks:
            return Math.floor((Math.max(e, 16) * Math.max(i, 8) * 2 + 7) / 8);
        case _s:
        case Is:
            return Math.floor((e + 3) / 4) * Math.floor((i + 3) / 4) * 16;
        case ms:
        case Rs:
            return Math.floor((e + 4) / 5) * Math.floor((i + 3) / 4) * 16;
        case xs:
        case Ds:
            return Math.floor((e + 4) / 5) * Math.floor((i + 4) / 5) * 16;
        case Ts:
        case Ls:
            return Math.floor((e + 5) / 6) * Math.floor((i + 4) / 5) * 16;
        case ws:
        case Fs:
            return Math.floor((e + 5) / 6) * Math.floor((i + 5) / 6) * 16;
        case bs:
        case Ns:
            return Math.floor((e + 7) / 8) * Math.floor((i + 4) / 5) * 16;
        case Es:
        case Us:
            return Math.floor((e + 7) / 8) * Math.floor((i + 5) / 6) * 16;
        case ks:
        case Bs:
            return Math.floor((e + 7) / 8) * Math.floor((i + 7) / 8) * 16;
        case Ss:
        case Xs:
            return Math.floor((e + 9) / 10) * Math.floor((i + 4) / 5) * 16;
        case Cs:
        case js:
            return Math.floor((e + 9) / 10) * Math.floor((i + 5) / 6) * 16;
        case Os:
        case Gs:
            return Math.floor((e + 9) / 10) * Math.floor((i + 7) / 8) * 16;
        case Ps:
        case Ws:
            return Math.floor((e + 9) / 10) * Math.floor((i + 9) / 10) * 16;
        case Ms:
        case Ys:
            return Math.floor((e + 11) / 12) * Math.floor((i + 9) / 10) * 16;
        case As:
        case Hs:
            return Math.floor((e + 11) / 12) * Math.floor((i + 11) / 12) * 16;
        default:
            return 0
        }
    }
    Jr.setExtensionXhrType("ktx", Jr.XHR_RESPONSE_TYPE.BUFFER);
    var $s = {
        extensions: [],
        detect: function (t) {
            if (t instanceof En) {
                var e = t.plugins.compressedTextureManager.getSupportedExtensions();
                e.pvrtc && this.extensions.push(".pvr"),
                e.astc && this.extensions.push(".astc")
            }
        },
        parse: function () {
            var t = function (t, e) {
                if (/\.ktx$/i.test(t.url)) {
                    var i = t.compressedImage || new Js(t.url);
                    if (t.data)
                        throw new Error("compressedImageParser middleware must be specified in loader.before() and must have zero resource.data");
                    t.isCompressedImage = !0,
                    t.data = i,
                    t.onComplete.add(function () {
                        t.type = Jr.TYPE.IMAGE,
                        i.loadFromArrayBuffer(t.data),
                        t.data = i
                    })
                }
                e()
            };
            return function (e, i) {
                var n = $s.extensions,
                r = e.metadata.useCompressedTexture;
                if (!r || 0 === n.length)
                    return i();
                var s = e.url,
                a = 0,
                o = "";
                if (-1 !== n.indexOf(".astc") && (o = ".astc"), $.apple.device && -1 !== n.indexOf(".pvr") && (o = ".pvr"), !e._defaultUrlChoice) {
                    if (e._defaultUrlChoice = s, !((a = s.lastIndexOf(".")) >= 0))
                        return i();
                    e._baseUrl = s.substring(0, a)
                }
                return /\.json$/i.test(e.url) ? e.metadata.imageMetadata = {
                    useCompressedTexture: r
                }
                 : (/\.ktx$/i.test(e.url) || (e.url = e._baseUrl + o + ".ktx"), e.extension = "ktx", e.loadType = e._determineLoadType()),
                t(e, i)
            }
        },
        fixer: function () {
            return function (t, e) {
                if (t.texture && t._defaultUrlChoice && t._defaultUrl !== t.url) {
                    var i = t.texture,
                    n = i.baseTexture;
                    delete We[n.imageUrl],
                    delete Ge[n.imageUrl],
                    n.imageUrl = t._defaultUrlChoice,
                    We[n.imageUrl] = n,
                    Ge[n.imageUrl] = i
                }
                e()
            }
        }
    },
    ta = {
        uploadNotCompressed: Ii.prototype.upload,
        isCompressed: !1,
        upload: function (t) {
            if (!(t instanceof Js))
                return this.uploadNotCompressed(t);
            this.bind();
            var e = this.gl;
            e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha),
            this.isCompressed = !0,
            t.generateWebGLTexture(e)
        },
        enableMipmap: function () {
            if (!this.isCompressed) {
                var t = this.gl;
                this.bind(),
                this.mipmap = !0,
                t.generateMipmap(t.TEXTURE_2D)
            }
        }
    };
    Object.assign(en.GLTexture.prototype, ta),
    En.registerPlugin("compressedTextureManager", cs),
    ss.addTinyMiddleware($s.fixer),
    ss.addTinyPreMiddleware($s.parse);
    var ea = {
        init: function (t) {
            $s.detect(t)
        },
        supportedExtensions: function () {
            return $s.extensions
        }
    },
    ia = Object.freeze({
        compressedTexture: ea
    });
    O();
    var na = us && ss ? new ss : null;
    t.Transition = Rr,
    t.interaction = Wr,
    t.loaders = us,
    t.ResourceLoader = es,
    t.plugins = ia,
    t.Loader = na,
    t.PI_2 = tt,
    t.RAD_TO_DEG = et,
    t.DEG_TO_RAD = it,
    t.URL_FILE_EXTENSION = nt,
    t.DATA_URI = rt,
    t.SVG_SIZE = st,
    t.RETINA_PREFIX = at,
    t.isArray = ot,
    t.isFunction = ht,
    t.isNumber = ut,
    t.isString = lt,
    t.isUndefined = ct,
    t.isObject = dt,
    t.getTime = ft,
    t.sign = function (t) {
        return Math.sign(t)
    },
    t.random = vt,
    t.randomInt = function () {
        return vt.call.apply(vt, [this].concat(Array.prototype.slice.call(arguments)))
    },
    t.randomFloat = function (t, e) {
        return t + Math.random() * (e - t)
    },
    t.randomBool = function (t) {
        return t = t || .5,
        Math.random() < t
    },
    t.randomPM = function (t) {
        return t = t || .5,
        Math.random() > t ? -1 : 1
    },
    t.randomFromArray = function (t) {
        return t[vt(0, t.length - 1)]
    },
    t.hex2rgb = pt,
    t.hex2string = gt,
    t.rgb2hex = yt,
    t.color2hex = function (t) {
        return yt([t.colorR / 255, t.colorG / 255, t.colorB / 255])
    },
    t.hex2color = _t,
    t.deg2radian = mt,
    t.radian2deg = xt,
    t.randomColor = Tt,
    t.getXMLHttpRequest = bt,
    t.detect = function (t, e, i, n, r) {
        var s = void 0;
        if (null !== t) {
            if (t.length === +t.length) {
                for (var a = 0, o = t.length; a < o; a++)
                    if (s = e.call(i, t[a], a, n, r))
                        return s;
                return !1
            }
            for (var h in t)
                if (s = e.call(i, t[h], h, n, r))
                    return s;
            return !1
        }
    },
    t.arrayRemoveObject = Et,
    t.removeItems = kt,
    t.getSvgSize = St,
    t.getUrlFileExtension = Ct,
    t.decomposeDataUri = Ot,
    t.getResolutionOfUrl = Pt,
    t.point = Mt,
    t.scale = At,
    t.color = It,
    t.TWEEN = w,
    t.isMobile = $,
    t.EventEmitter = f,
    t.mixins = P,
    t.base64 = E,
    t.url = I,
    t.determineCrossOrigin = D,
    t.settings = Ze,
    t.ticker = ni,
    t.CanvasRenderer = Si,
    t.WebGLRenderer = En,
    t.config = Je,
    t.defaultConfig = Qe,
    t.glCore = en,
    t.Bounds = oi,
    t.DisplayObject = hi,
    t.Container = ui,
    t.Transform = ai,
    t.TransformStatic = si,
    t.TransformBase = ri,
    t.Sprite = Sn,
    t.AnimatedSprite = Cn,
    t.CanvasSpriteRenderer = Mn,
    t.CanvasTinter = On,
    t.SpriteRenderer = Un,
    t.Text = qn,
    t.TextStyle = jn,
    t.TextMetrics = Hn,
    t.Graphics = er,
    t.GraphicsData = Kn,
    t.GraphicsRenderer = cr,
    t.CanvasGraphicsRenderer = dr,
    t.Spritesheet = fr,
    t.Texture = yi,
    t.BaseTexture = di,
    t.RenderTexture = mi,
    t.BaseRenderTexture = fi,
    t.VideoBaseTexture = vi,
    t.TextureUvs = gi,
    t.TextureTransform = hn,
    t.CanvasRenderTarget = bi,
    t.Shader = gn,
    t.WebGLManager = Ci,
    t.ObjectRenderer = mn,
    t.RenderTarget = fn,
    t.Quad = pn,
    t.SpriteMaskFilter = ln,
    t.Filter = an,
    t.Application = Lr,
    t.VERSION = "1.3.1",
    t.RENDERER_TYPE = Rt,
    t.BLEND_MODES = Dt,
    t.DRAW_MODES = Lt,
    t.SCALE_MODES = Ft,
    t.WRAP_MODES = Nt,
    t.GC_MODES = Ut,
    t.SHAPES = Bt,
    t.PRECISION = {
        LOW: "lowp",
        MEDIUM: "mediump",
        HIGH: "highp"
    },
    t.TRANSFORM_MODE = Xt,
    t.TEXT_GRADIENT = jt,
    t.UPDATE_PRIORITY = Gt,
    t.WIN_SIZE = Wt,
    t.Point = Yt,
    t.ObservablePoint = Ht,
    t.Matrix = Vt,
    t.GroupD8 = te,
    t.Circle = ie,
    t.Ellipse = ne,
    t.Polygon = re,
    t.Rectangle = ee,
    t.RoundedRectangle = se,
    t.pluginTarget = ae,
    t.earcut = oe,
    t.uid = Xe,
    t.isWebGLSupported = je,
    t.TextureCache = Ge,
    t.BaseTextureCache = We,
    t.CountDownCache = Ye,
    t.destroyTextureCache = function () {
        var t = void 0;
        for (t in Ge)
            Ge[t].destroy();
        for (t in We)
            We[t].destroy()
    },
    t.clearTextureCache = function () {
        var t = void 0;
        for (t in Ge)
            delete Ge[t];
        for (t in We)
            delete We[t]
    },
    t.premultiplyBlendMode = He,
    t.correctBlendMode = function (t, e) {
        return He[e ? 1 : 0][t]
    },
    t.premultiplyTint = Ve,
    t.premultiplyRgba = function (t, e, i, n) {
        return i = i || new Float32Array(4),
        n || void 0 === n ? (i[0] = t[0] * e, i[1] = t[1] * e, i[2] = t[2] * e) : (i[0] = t[0], i[1] = t[1], i[2] = t[2]),
        i[3] = e,
        i
    },
    t.premultiplyTintToRgba = function (t, e, i, n) {
        return (i = i || new Float32Array(4))[0] = (t >> 16 & 255) / 255,
        i[1] = (t >> 8 & 255) / 255,
        i[2] = (255 & t) / 255,
        (n || void 0 === n) && (i[0] *= e, i[1] *= e, i[2] *= e),
        i[3] = e,
        i
    },
    t.__frameDot = ze,
    t.equalsFramCount = qe,
    t.rectContainsRect = function (t, e) {
        return !(!t || !e || t.x >= e.x || t.y >= e.y || t.x + t.width <= e.x + e.width || t.y + t.height <= e.y + e.height)
    },
    t.rectGetMaxX = Le,
    t.rectGetMidX = function (t) {
        return t.x + t.width / 2
    },
    t.rectGetMinX = Fe,
    t.rectGetMaxY = Ne,
    t.rectGetMidY = function (t) {
        return t.y + t.height / 2
    },
    t.rectGetMinY = Ue,
    t.rectContainsPoint = function (t, e) {
        return e.x >= Fe(t) && e.x <= Le(t) && e.y >= Ue(t) && e.y <= Ne(t)
    },
    t.rectIntersectsRect = function (t, e) {
        return !(Le(t) < Fe(e) || Le(e) < Fe(t) || Ne(t) < Ue(e) || Ne(e) < Ue(t))
    },
    t.rectUnion = function (t, e) {
        var i = ee.EMPTY;
        return i.x = Math.min(t.x, e.x),
        i.y = Math.min(t.y, e.y),
        i.width = Math.max(t.x + t.width, e.x + e.width) - i.x,
        i.height = Math.max(t.y + t.height, e.y + e.height) - i.y,
        i
    },
    t.isPixelCollision = function (t, e, i, n, r, s, a, o) {
        e = Math.round(e),
        i = Math.round(i),
        s = Math.round(s),
        a = Math.round(a);
        var h = t.collisionWidth || t.width,
        u = t.collisionHeight || t.height,
        l = r.collisionWidth || r.width,
        c = r.collisionHeight || r.height;
        n && (e -= h / 2 + .5 << 0, i -= u / 2 + .5 << 0),
        o && (s -= l / 2 + .5 << 0, a -= c / 2 + .5 << 0);
        var d = Math.max(e, s),
        f = Math.max(i, a),
        v = Math.min(e + h, s + l),
        p = Math.min(i + u, a + c);
        if (d >= v || f >= p)
            return !1;
        var g = v - d,
        y = p - f,
        _ = t.data,
        m = r.data;
        if (!_ || !m)
            throw new Error("The Sprit's data cannot be null" + (!_ && ", first.data is " + _) + (!m && ", other.data is " + m + "."));
        if (g < 4 && y < 4) {
            for (var x = d; x < v; x++)
                for (var T = f; T < p; T++)
                    if (0 !== _[4 * (x - e + (T - i) * h) + 3] && 0 !== m[4 * (x - s + (T - a) * l) + 3])
                        return !0
        } else {
            var w = g / 3,
            b = y / 3;
            w = ~~w === w ? w : w + 1 | 0,
            b = ~~b === b ? b : b + 1 | 0;
            for (var E = 0; E < b; E++)
                for (var k = 0; k < w; k++)
                    for (var S = f + E; S < p; S += b)
                        for (var C = d + k; C < v; C += w)
                            if (0 !== _[4 * (C - e + (S - i) * h) + 3] && 0 !== m[4 * (C - s + (S - a) * l) + 3])
                                return !0
        }
        return !1
    },
    t.Action = gr,
    t.MoveBy = yr,
    t.MoveTo = _r,
    t.ScaleBy = mr,
    t.ScaleTo = xr,
    t.RotateBy = Tr,
    t.RotateTo = wr,
    t.JumpTo = br,
    t.Blink = Er,
    t.FadeTo = kr,
    t.FadeIn = Sr,
    t.FadeOut = Cr,
    t.TintBy = Or,
    t.TintTo = Pr,
    t.RepeatForever = Mr,
    t.Repeat = Ar,
    t.Back = Ir,
    Object.defineProperty(t, "__esModule", {
        value: !0
    })
});